Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix geniushub smart plug state at start-up #102110

7 changes: 5 additions & 2 deletions homeassistant/components/geniushub/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ def device_class(self):
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.
Expand Down