1 """DataUpdateCoordinator for the ping integration."""
3 from __future__
import annotations
5 from dataclasses
import dataclass
6 from datetime
import timedelta
13 from .helpers
import PingDataICMPLib, PingDataSubProcess
15 _LOGGER = logging.getLogger(__name__)
18 @dataclass(slots=True, frozen=True)
20 """Dataclass returned by the coordinator."""
28 """The Ping update coordinator."""
30 ping: PingDataSubProcess | PingDataICMPLib
35 ping: PingDataSubProcess | PingDataICMPLib,
37 """Initialize the Ping coordinator."""
43 name=f
"Ping {ping.ip_address}",
48 """Trigger ping check."""
51 ip_address=self.
pingping.ip_address,
52 is_alive=self.
pingping.is_alive,
53 data=self.
pingping.data
or {},
PingResult _async_update_data(self)
None __init__(self, HomeAssistant hass, PingDataSubProcess|PingDataICMPLib ping)