1
mirror of https://github.com/home-assistant/core synced 2024-08-28 03:36:46 +02:00
ha-core/homeassistant/components/nextdns/system_health.py
Maciej Bieniek 8ccb008834
Address NextDNS late review (#74503)
* Fix coordinator type

* Remove pylint disable
2022-07-06 14:29:26 +02:00

25 lines
673 B
Python

"""Provide info to system health."""
from __future__ import annotations
from typing import Any
from nextdns.const import API_ENDPOINT
from homeassistant.components import system_health
from homeassistant.core import HomeAssistant, callback
@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: HomeAssistant) -> dict[str, Any]:
"""Get info for the info page."""
return {
"can_reach_server": system_health.async_check_can_reach_url(hass, API_ENDPOINT)
}