1 """Provide info to system health."""
9 from .const
import DOMAIN, MODE_AUTO, MODE_STORAGE, MODE_YAML
16 """Register system health callbacks."""
17 register.async_register_info(system_health_info,
"/config/lovelace")
21 """Get info for the info page."""
22 health_info = {
"dashboards": len(hass.data[DOMAIN][
"dashboards"])}
23 health_info.update(await hass.data[DOMAIN][
"resources"].async_get_info())
25 dashboards_info = await asyncio.gather(
27 hass.data[DOMAIN][
"dashboards"][dashboard].async_get_info()
28 for dashboard
in hass.data[DOMAIN][
"dashboards"]
33 for dashboard
in dashboards_info:
35 if isinstance(dashboard[key], int):
36 health_info[key] = health_info.get(key, 0) + dashboard[key]
37 elif key == CONF_MODE:
38 modes.add(dashboard[key])
40 health_info[key] = dashboard[key]
42 if hass.data[DOMAIN][CONF_MODE] == MODE_YAML:
43 health_info[CONF_MODE] = MODE_YAML
44 elif MODE_STORAGE
in modes:
45 health_info[CONF_MODE] = MODE_STORAGE
46 elif MODE_YAML
in modes:
47 health_info[CONF_MODE] = MODE_YAML
49 health_info[CONF_MODE] = MODE_AUTO
def system_health_info(hass)
None async_register(HomeAssistant hass, system_health.SystemHealthRegistration register)