-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiagnostics.py
More file actions
32 lines (24 loc) · 854 Bytes
/
diagnostics.py
File metadata and controls
32 lines (24 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""Diagnostics support for nexia."""
from __future__ import annotations
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),
}