Fix geniushub smart plug state at start-up (#102110)

* Smart plug did state wrong at start-up

* Update docstring to reflect code
This commit is contained in:
GeoffAtHome 2023-12-05 13:03:39 +00:00 committed by Franck Nijhof
parent ca147060d9
commit 55bafc260d
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3

View file

@ -68,9 +68,12 @@ class GeniusSwitch(GeniusZone, SwitchEntity):
def is_on(self) -> bool:
"""Return the current state of the on/off zone.
The zone is considered 'on' if & only if it is override/on (e.g. timer/on is 'off').
The zone is considered 'on' if the mode is either 'override' or 'timer'.
"""
return self._zone.data["mode"] == "override" and self._zone.data["setpoint"]
return (
self._zone.data["mode"] in ["override", "timer"]
and self._zone.data["setpoint"]
)
async def async_turn_off(self, **kwargs: Any) -> None:
"""Send the zone to Timer mode.