climate/generic_thermostat: saved temperature lost on away_mode set multiple times · Issue #17433 · home-assistant/core · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of problem:
There is no gating on async_turn_away_mode_on to make sure the thermostat is not already set to away_mode. As such, it is possible to call climate.set_away_mode() multiple times in sequence, which will cause the initial, pre-away_mode target_temp to be lost.
* Resolves /#17433
Away mode temperature issue fix for generic_thermostat
* Debug messages removed from generic_thermostat.py
* Test for repeat away_mode set
Test for fix of generic thermostat issue when away_mode was set several times in a row.
* Code style fix in generic_thermostat
* Remove blank line in the end of generic_thermostat
* Fix style
Home Assistant release with the issue: 0.80.0
Last working Home Assistant release (if known):
Operating environment (Hass.io/Docker/Windows/etc.): docker, x86_64
Component/platform: https://www.home-assistant.io/components/climate.generic_thermostat/
Description of problem:
There is no gating on async_turn_away_mode_on to make sure the thermostat is not already set to away_mode. As such, it is possible to call climate.set_away_mode() multiple times in sequence, which will cause the initial, pre-away_mode target_temp to be lost.
Relevant code here: https://github.com/home-assistant/home-assistant/blob/8eb4e77365acc327d1408f7aa002b53b4a9ff31f/homeassistant/components/climate/generic_thermostat.py#L384-L385
=> _saved_target_temp will get overwritten with the current _target_temp. If calling the method multiple times, the first call will copy _target temp to _saved, then _away_temp to _target_temp, any subsequent call will overwrite _saved with what was initially _away_temp.
Consider gating async_turn_away_mode_on on self._is_away not already true, return early, which would resolve this issue.
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Traceback (if applicable):
Additional information:
The text was updated successfully, but these errors were encountered: