mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Fix timer switch in Sensibo (#96911)
This commit is contained in:
parent
effa90272d
commit
3fbdf4a184
@ -151,9 +151,10 @@ class SensiboDeviceSwitch(SensiboDeviceBaseEntity, SwitchEntity):
|
|||||||
@async_handle_api_call
|
@async_handle_api_call
|
||||||
async def async_turn_on_timer(self, key: str, value: bool) -> bool:
|
async def async_turn_on_timer(self, key: str, value: bool) -> bool:
|
||||||
"""Make service call to api for setting timer."""
|
"""Make service call to api for setting timer."""
|
||||||
|
new_state = not self.device_data.device_on
|
||||||
data = {
|
data = {
|
||||||
"minutesFromNow": 60,
|
"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)
|
result = await self._client.async_set_timer(self._device_id, data)
|
||||||
return bool(result.get("status") == "success")
|
return bool(result.get("status") == "success")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user