8000 climate/generic_thermostat: saved temperature lost on away_mode set multiple times · Issue #17433 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

climate/generic_thermostat: saved temperature lost on away_mode set multiple times #17433

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

Closed
Skee opened this issue Oct 14, 2018 · 0 comments · Fixed by #17641
Closed

climate/generic_thermostat: saved temperature lost on away_mode set multiple times #17433

Skee opened this issue Oct 14, 2018 · 0 comments · Fixed by #17641
Assignees

Comments

@Skee
Copy link
Skee commented Oct 14, 2018

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):

climate:
  - platform: generic_thermostat
    name: Heating
    heater: switch.qubino_zmnhnd1_flush_1d_relay_switch
    target_sensor: sensor.avg_indoor_temp
    min_temp: 16
    max_temp: 30
    target_temp: 22
    cold_tolerance: 0.5
    hot_tolerance: 0.5
    min_cycle_duration:
      minutes: 30
    initial_operation_mode: "auto"
    away_temp: 16

Traceback (if applicable):


Additional information:

@ghost ghost added the in progress label Oct 20, 2018
@ghost ghost assigned Danielhiversen Oct 22, 2018
@ghost ghost removed the in progress label Oct 23, 2018
Danielhiversen pushed a commit that referenced this issue Oct 23, 2018
* 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 home-assistant locked and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0