mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
Improve target temperature selection logic
When picking which of the high/low temperatures to display as the "target", it makes more sense to take the outside temperature into consideration, rather than the current temperature of the thermostat. If the temperature outside is less than the temperature of the thermostat, then we are far more likely to end up in "heating" mode eventually, and vice versa, regardless of where the current inside temp falls in the range between high and low.
This commit is contained in:
parent
c4a71fbfa7
commit
942d722dcf
@ -88,8 +88,10 @@ class NestThermostat(ThermostatDevice):
|
||||
elif self.operation == STATE_HEAT:
|
||||
temp = low
|
||||
else:
|
||||
range_average = (low + high)/2
|
||||
if self.current_temperature < range_average:
|
||||
# If the outside temp is lower than the current temp, consider
|
||||
# the 'low' temp to the target, otherwise use the high temp
|
||||
if (self.device.structure.weather.current.temperature <
|
||||
self.current_temperature):
|
||||
temp = low
|
||||
elif self.current_temperature >= range_average:
|
||||
temp = high
|
||||
|
Loading…
x
Reference in New Issue
Block a user