Fix the Hydrawise status sensor (#99271)

This commit is contained in:
David Knowles
2023-09-08 19:59:28 +02:00
committed by Bram Kragten
parent d369a70092
commit 39669bc788
@@ -90,7 +90,7 @@ class HydrawiseBinarySensor(HydrawiseEntity, BinarySensorEntity):
"""Get the latest data and updates the state."""
LOGGER.debug("Updating Hydrawise binary sensor: %s", self.name)
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":
relay_data = self.coordinator.api.relays_by_zone_number[self.data["relay"]]
self._attr_is_on = relay_data["timestr"] == "Now"