core/homeassistant/components/litejet/diagnostics.py

25 lines
661 B
Python

"""Support for LiteJet diagnostics."""
from typing import Any
from pylitejet import LiteJet
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .const import DOMAIN
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, entry: ConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for LiteJet config entry."""
system: LiteJet = hass.data[DOMAIN]
return {
"model": system.model_name,
"loads": list(system.loads()),
"button_switches": list(system.button_switches()),
"scenes": list(system.scenes()),
"connected": system.connected,
}