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 homeassistant.components import system_health
4 from homeassistant.core import HomeAssistant, callback
5 
6 IPMA_API_URL = "http://api.ipma.pt"
7 
8 
9 @callback
11  hass: HomeAssistant, register: system_health.SystemHealthRegistration
12 ) -> None:
13  """Register system health callbacks."""
14  register.async_register_info(system_health_info)
15 
16 
17 async def system_health_info(hass):
18  """Get info for the info page."""
19  return {
20  "api_endpoint_reachable": system_health.async_check_can_reach_url(
21  hass, IPMA_API_URL
22  )
23  }
None async_register(HomeAssistant hass, system_health.SystemHealthRegistration register)