1 """Provide info to system health."""
3 from __future__
import annotations
7 from airly
import Airly
12 from .
import AirlyConfigEntry
13 from .const
import DOMAIN
20 """Register system health callbacks."""
21 register.async_register_info(system_health_info)
25 """Get info for the info page."""
26 config_entry: AirlyConfigEntry = hass.config_entries.async_entries(DOMAIN)[0]
28 requests_remaining = config_entry.runtime_data.airly.requests_remaining
29 requests_per_day = config_entry.runtime_data.airly.requests_per_day
32 "can_reach_server": system_health.async_check_can_reach_url(
33 hass, Airly.AIRLY_API_URL
35 "requests_remaining": requests_remaining,
36 "requests_per_day": requests_per_day,
None async_register(HomeAssistant hass, system_health.SystemHealthRegistration register)
dict[str, Any] system_health_info(HomeAssistant hass)