-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from jschlyter/system_health
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
} |