1 """Provide info to system health."""
8 from .const
import DATA_CLOUD
15 """Register system health callbacks."""
16 register.async_register_info(system_health_info,
"/config/cloud")
20 """Get info for the info page."""
21 cloud = hass.data[DATA_CLOUD]
24 data: dict[str, Any] = {
25 "logged_in": cloud.is_logged_in,
28 if cloud.is_logged_in:
29 data[
"subscription_expiration"] = cloud.expiration_date
30 data[
"relayer_connected"] = cloud.is_connected
31 data[
"relayer_region"] = client.relayer_region
32 data[
"remote_enabled"] = client.prefs.remote_enabled
33 data[
"remote_connected"] = cloud.remote.is_connected
34 data[
"alexa_enabled"] = client.prefs.alexa_enabled
35 data[
"google_enabled"] = client.prefs.google_enabled
36 data[
"cloud_ice_servers_enabled"] = client.prefs.cloud_ice_servers_enabled
37 data[
"remote_server"] = cloud.remote.snitun_server
38 data[
"certificate_status"] = cloud.remote.certificate_status
39 data[
"instance_id"] = client.prefs.instance_id
41 data[
"can_reach_cert_server"] = system_health.async_check_can_reach_url(
42 hass, f
"https://{cloud.acme_server}/directory"
44 data[
"can_reach_cloud_auth"] = system_health.async_check_can_reach_url(
46 f
"https://cognito-idp.{cloud.region}.amazonaws.com/{cloud.user_pool_id}/.well-known/jwks.json",
48 data[
"can_reach_cloud"] = system_health.async_check_can_reach_url(
49 hass, f
"https://{cloud.relayer_server}/status"
dict[str, Any] system_health_info(HomeAssistant hass)
None async_register(HomeAssistant hass, system_health.SystemHealthRegistration register)