Home Assistant Unofficial Reference 2024.12.1
system_health.py
Go to the documentation of this file.
1 """Provide info to system health."""
2 
3 from __future__ import annotations
4 
5 from typing import Any, Final
6 
7 from homeassistant.components import system_health
8 from homeassistant.core import HomeAssistant, callback
9 
10 API_ENDPOINT: Final = "http://api.gios.gov.pl/"
11 
12 
13 @callback
15  hass: HomeAssistant, register: system_health.SystemHealthRegistration
16 ) -> None:
17  """Register system health callbacks."""
18  register.async_register_info(system_health_info)
19 
20 
21 async def system_health_info(hass: HomeAssistant) -> dict[str, Any]:
22  """Get info for the info page."""
23  return {
24  "can_reach_server": system_health.async_check_can_reach_url(hass, API_ENDPOINT)
25  }
dict[str, Any] system_health_info(HomeAssistant hass)
None async_register(HomeAssistant hass, system_health.SystemHealthRegistration register)