Skip to content
Snippets Groups Projects
Commit 17af1a68 authored by Paulus Schoutsen's avatar Paulus Schoutsen
Browse files

Fix for Nest thermostats with a range as target temperature

parent e56fccae
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,21 @@ class NestThermostat(ThermostatDevice): ...@@ -74,7 +74,21 @@ class NestThermostat(ThermostatDevice):
@property @property
def target_temperature(self): def target_temperature(self):
""" Returns the temperature we try to reach. """ """ 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 @property
def is_away_mode_on(self): def is_away_mode_on(self):
......
...@@ -33,7 +33,7 @@ python-libnmap>=0.6.2 ...@@ -33,7 +33,7 @@ python-libnmap>=0.6.2
pushbullet.py>=0.7.1 pushbullet.py>=0.7.1
# Nest Thermostat bindings (thermostat.nest) # Nest Thermostat bindings (thermostat.nest)
python-nest>=2.1 python-nest>=2.3.1
# Z-Wave (*.zwave) # Z-Wave (*.zwave)
pydispatcher>=2.0.5 pydispatcher>=2.0.5
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment