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 timer switch in Sensibo #96911

Merged
merged 2 commits into from
Jul 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion homeassistant/components/sensibo/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,11 @@ def extra_state_attributes(self) -> Mapping[str, Any] | None:
@async_handle_api_call
async def async_turn_on_timer(self, key: str, value: bool) -> bool:
"""Make service call to api for setting timer."""
current_state = self.device_data.device_on
new_state = bool(current_state is False)
gjohansson-ST marked this conversation as resolved.
Show resolved Hide resolved
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")
Expand Down