mirror of
https://github.com/home-assistant/core.git
synced 2026-07-06 22:36:33 +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>
31 lines
818 B
Python
31 lines
818 B
Python
"""Diagnostics support for nexia."""
|
|
|
|
from typing import Any
|
|
|
|
from homeassistant.components.diagnostics import async_redact_data
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .const import CONF_BRAND
|
|
from .types import NexiaConfigEntry
|
|
|
|
TO_REDACT = {
|
|
"dealer_contact_info",
|
|
}
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
hass: HomeAssistant, entry: NexiaConfigEntry
|
|
) -> dict[str, Any]:
|
|
"""Return diagnostics for a config entry."""
|
|
coordinator = entry.runtime_data
|
|
nexia_home = coordinator.nexia_home
|
|
|
|
return {
|
|
"entry": {
|
|
"title": entry.title,
|
|
"brand": entry.data.get(CONF_BRAND),
|
|
},
|
|
"automations": async_redact_data(nexia_home.automations_json, TO_REDACT),
|
|
"devices": async_redact_data(nexia_home.devices_json, TO_REDACT),
|
|
}
|