mirror of
https://github.com/home-assistant/core.git
synced 2026-07-01 11:46:40 +01:00
d766aae436
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
27 lines
754 B
Python
27 lines
754 B
Python
"""Diagnostics support for Tractive."""
|
|
|
|
from typing import Any
|
|
|
|
from homeassistant.components.diagnostics import async_redact_data
|
|
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from . import TractiveConfigEntry
|
|
|
|
TO_REDACT = {CONF_PASSWORD, CONF_EMAIL, "title", "_id"}
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
hass: HomeAssistant, config_entry: TractiveConfigEntry
|
|
) -> dict[str, Any]:
|
|
"""Return diagnostics for a config entry."""
|
|
trackables = config_entry.runtime_data.trackables
|
|
|
|
return async_redact_data(
|
|
{
|
|
"config_entry": config_entry.as_dict(),
|
|
"trackables": [item.trackable for item in trackables],
|
|
},
|
|
TO_REDACT,
|
|
)
|