From 3fbdf4a184d43ae0382210baa03d5fbac68003d9 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Thu, 20 Jul 2023 11:27:30 +0200 Subject: [PATCH] Fix timer switch in Sensibo (#96911) --- homeassistant/components/sensibo/switch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/sensibo/switch.py b/homeassistant/components/sensibo/switch.py index 20167ddd184..204ed622f13 100644 --- a/homeassistant/components/sensibo/switch.py +++ b/homeassistant/components/sensibo/switch.py @@ -151,9 +151,10 @@ class SensiboDeviceSwitch(SensiboDeviceBaseEntity, SwitchEntity): @async_handle_api_call async def async_turn_on_timer(self, key: str, value: bool) -> bool: """Make service call to api for setting timer.""" + new_state = not self.device_data.device_on data = { "minutesFromNow": 60, - "acState": {**self.device_data.ac_states, "on": value}, + "acState": {**self.device_data.ac_states, "on": new_state}, } result = await self._client.async_set_timer(self._device_id, data) return bool(result.get("status") == "success")