2022-02-08 11:43:45 +00:00
|
|
|
"""Diagnostics support for Plugwise."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
from typing import Any
|
|
|
|
|
|
|
|
from homeassistant.config_entries import ConfigEntry
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
|
2022-02-08 19:17:49 +00:00
|
|
|
from .const import DOMAIN
|
2022-02-08 11:43:45 +00:00
|
|
|
from .coordinator import PlugwiseDataUpdateCoordinator
|
|
|
|
|
|
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
|
|
hass: HomeAssistant, entry: ConfigEntry
|
|
|
|
) -> dict[str, Any]:
|
|
|
|
"""Return diagnostics for a config entry."""
|
2022-02-08 19:17:49 +00:00
|
|
|
coordinator: PlugwiseDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
2022-02-08 11:43:45 +00:00
|
|
|
return {
|
|
|
|
"gateway": coordinator.data.gateway,
|
|
|
|
"devices": coordinator.data.devices,
|
|
|
|
}
|