1 """Adapter to wrap the rachiopy api for home assistant."""
3 from abc
import abstractmethod
21 from .coordinator
import RachioUpdateCoordinator
22 from .device
import RachioIro
26 """Base class for rachio devices."""
28 _attr_should_poll =
False
30 def __init__(self, controller: RachioIro) ->
None:
31 """Initialize a Rachio device."""
43 dr.CONNECTION_NETWORK_MAC,
49 manufacturer=DEFAULT_NAME,
50 configuration_url=
"https://app.rach.io",
55 """Base class for smart hose timer entities."""
57 _attr_has_entity_name =
True
60 self, data: dict[str, Any], coordinator: RachioUpdateCoordinator
62 """Initialize a Rachio smart hose timer entity."""
64 self.
idid = data[KEY_ID]
65 self.
_name_name = data[KEY_NAME]
67 identifiers={(DOMAIN, self.
idid)},
68 model=
"Smart Hose Timer",
70 manufacturer=DEFAULT_NAME,
71 configuration_url=
"https://app.rach.io",
77 """Return if the entity is available."""
80 and self.coordinator.data[self.
idid][KEY_STATE][KEY_REPORTED_STATE][
87 """Update the state and attributes."""
91 """Handle updated data from the coordinator."""
None __init__(self, RachioIro controller)
None __init__(self, dict[str, Any] data, RachioUpdateCoordinator coordinator)
None _handle_coordinator_update(self)