#3829 - Fixed issued LowHighTuple doesn't define __round__ method for Nest Sensor (#3881)

* #3829 - Fixed type LowHighTuple doesn't define __round__ method issue when Nest is operating in range mode

* Testing if temperature is a tuple instead int or float
This commit is contained in:
Marcelo Moreira de Mello 2016-10-17 22:55:53 -04:00 committed by Paulus Schoutsen
parent c54476b62f
commit 76598bc4d2

View File

@ -135,7 +135,11 @@ class NestTempSensor(NestSensor):
if temp is None:
return None
return round(temp, 1)
if isinstance(temp, tuple):
low, high = temp
return "%s-%s" % (int(low), int(high))
else:
return round(temp, 1)
class NestWeatherSensor(NestSensor):