2022-01-18 20:02:37 +00:00
|
|
|
"""Diagnostics support for Evil Genius Labs."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
2022-01-20 22:02:47 +00:00
|
|
|
from homeassistant.components.diagnostics import async_redact_data
|
2022-01-18 20:02:37 +00:00
|
|
|
from homeassistant.config_entries import ConfigEntry
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
|
|
|
|
from . import EvilGeniusUpdateCoordinator
|
|
|
|
from .const import DOMAIN
|
|
|
|
|
2022-01-20 22:02:47 +00:00
|
|
|
TO_REDACT = {"wiFiSsidDefault", "wiFiSSID"}
|
|
|
|
|
2022-01-18 20:02:37 +00:00
|
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
|
|
hass: HomeAssistant, config_entry: ConfigEntry
|
|
|
|
) -> dict:
|
|
|
|
"""Return diagnostics for a config entry."""
|
|
|
|
coordinator: EvilGeniusUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
|
|
|
|
|
|
|
|
return {
|
2022-01-20 22:02:47 +00:00
|
|
|
"info": async_redact_data(coordinator.info, TO_REDACT),
|
2022-04-15 17:54:20 +00:00
|
|
|
"all": coordinator.data,
|
2022-01-18 20:02:37 +00:00
|
|
|
}
|