Fix for Nest thermostats with a range as target temperature

This commit is contained in:
Paulus Schoutsen 2015-06-01 22:00:41 -07:00
parent e56fccaefe
commit 17af1a68e8
2 changed files with 16 additions and 2 deletions

View file

@ -74,7 +74,21 @@ class NestThermostat(ThermostatDevice):
@property
def target_temperature(self):
""" Returns the temperature we try to reach. """
return round(self.device.target, 1)
target = self.device.target
if isinstance(target, tuple):
low, high = target
if self.current_temperature < low:
target = low
elif self.current_temperature > high:
target = high
else:
target = low + high
else:
temp = target
return round(temp, 1)
@property
def is_away_mode_on(self):

View file

@ -33,7 +33,7 @@ python-libnmap>=0.6.2
pushbullet.py>=0.7.1
# Nest Thermostat bindings (thermostat.nest)
python-nest>=2.1
python-nest>=2.3.1
# Z-Wave (*.zwave)
pydispatcher>=2.0.5