Fix the Hydrawise status sensor (#99271)
This commit is contained in:
parent
c9a6ea94a7
commit
0b95e4ac17
1 changed files with 1 additions and 1 deletions
|
@ -90,7 +90,7 @@ class HydrawiseBinarySensor(HydrawiseEntity, BinarySensorEntity):
|
||||||
"""Get the latest data and updates the state."""
|
"""Get the latest data and updates the state."""
|
||||||
LOGGER.debug("Updating Hydrawise binary sensor: %s", self.name)
|
LOGGER.debug("Updating Hydrawise binary sensor: %s", self.name)
|
||||||
if self.entity_description.key == "status":
|
if self.entity_description.key == "status":
|
||||||
self._attr_is_on = self.coordinator.api.status == "All good!"
|
self._attr_is_on = self.coordinator.last_update_success
|
||||||
elif self.entity_description.key == "is_watering":
|
elif self.entity_description.key == "is_watering":
|
||||||
relay_data = self.coordinator.api.relays_by_zone_number[self.data["relay"]]
|
relay_data = self.coordinator.api.relays_by_zone_number[self.data["relay"]]
|
||||||
self._attr_is_on = relay_data["timestr"] == "Now"
|
self._attr_is_on = relay_data["timestr"] == "Now"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue