core/homeassistant/components/evil_genius_labs/diagnostics.py

24 lines
727 B
Python
Raw Normal View History

"""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
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"}
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),
"all": coordinator.data,
}