2022-04-13 21:12:56 +00:00
|
|
|
"""Diagnostics support for GIOS."""
|
2024-03-08 13:52:48 +00:00
|
|
|
|
2022-04-13 21:12:56 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
from dataclasses import asdict
|
2023-01-09 14:17:48 +00:00
|
|
|
from typing import Any
|
2022-04-13 21:12:56 +00:00
|
|
|
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
|
2024-05-01 15:28:20 +00:00
|
|
|
from . import GiosConfigEntry
|
2022-04-13 21:12:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
2024-05-01 15:28:20 +00:00
|
|
|
hass: HomeAssistant, config_entry: GiosConfigEntry
|
2023-01-09 14:17:48 +00:00
|
|
|
) -> dict[str, Any]:
|
2022-04-13 21:12:56 +00:00
|
|
|
"""Return diagnostics for a config entry."""
|
2024-05-01 15:28:20 +00:00
|
|
|
coordinator = config_entry.runtime_data.coordinator
|
2022-04-13 21:12:56 +00:00
|
|
|
|
2024-04-06 09:07:37 +00:00
|
|
|
return {
|
2022-04-13 21:12:56 +00:00
|
|
|
"config_entry": config_entry.as_dict(),
|
|
|
|
"coordinator_data": asdict(coordinator.data),
|
|
|
|
}
|