Fix timer switch in Sensibo (#96911)

pull/96965/head
G Johansson 2023-07-20 11:27:30 +02:00 committed by Franck Nijhof
parent 0c10005270
commit db32aa7c5e
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
1 changed files with 2 additions and 1 deletions

View File

@ -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")