From 76598bc4d22be2b723ab81529092932fbbc77a62 Mon Sep 17 00:00:00 2001 From: Marcelo Moreira de Mello Date: Mon, 17 Oct 2016 22:55:53 -0400 Subject: [PATCH] #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 --- homeassistant/components/sensor/nest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/nest.py b/homeassistant/components/sensor/nest.py index 135fc22895d..98d018a7c0b 100644 --- a/homeassistant/components/sensor/nest.py +++ b/homeassistant/components/sensor/nest.py @@ -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):