Skip to content

Commit

Permalink
Merge pull request #235 from jschlyter/system_health
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter authored Nov 13, 2024
2 parents 3a6f5ed + ae0ce69 commit 0763005
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ logbook:

history:

system_health:

# https://www.home-assistant.io/integrations/logger/
logger:
default: info
Expand Down
22 changes: 22 additions & 0 deletions custom_components/polestar_api/system_health.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Provide info to system health."""

from homeassistant.components import system_health
from homeassistant.core import HomeAssistant, callback

from .pypolestar.const import API_AUTH_URL, API_MYSTAR_V2_URL


@callback
def async_register(
hass: HomeAssistant, register: system_health.SystemHealthRegistration
) -> None:
"""Register system health callbacks."""
register.async_register_info(system_health_info)


async def system_health_info(hass):
"""Get info for the info page."""
return {
"Auth API": system_health.async_check_can_reach_url(hass, API_AUTH_URL),
"Data API": system_health.async_check_can_reach_url(hass, API_MYSTAR_V2_URL),
}

0 comments on commit 0763005

Please sign in to comment.