diff --git a/homeassistant/components/climate/__init__.py b/homeassistant/components/climate/__init__.py index f9405e4b040cb..d00d30c3b1945 100644 --- a/homeassistant/components/climate/__init__.py +++ b/homeassistant/components/climate/__init__.py @@ -693,8 +693,14 @@ def max_humidity(self): def _convert_for_display(self, temp): """Convert temperature into preferred units for display purposes.""" - if temp is None or not isinstance(temp, Number): + if temp is None: return temp + + # if the temperature is not a number this can cause issues + # with polymer components, so bail early there. + if not isinstance(temp, Number): + raise TypeError("Temperature is not a number: %s" % temp) + if self.temperature_unit != self.unit_of_measurement: temp = convert_temperature( temp, self.temperature_unit, self.unit_of_measurement) diff --git a/homeassistant/components/climate/mysensors.py b/homeassistant/components/climate/mysensors.py index adf44a818292b..9fd6059acbe12 100755 --- a/homeassistant/components/climate/mysensors.py +++ b/homeassistant/components/climate/mysensors.py @@ -67,7 +67,7 @@ def temperature_unit(self): @property def current_temperature(self): """Return the current temperature.""" - return self._values.get(self.gateway.const.SetReq.V_TEMP) + return float(self._values.get(self.gateway.const.SetReq.V_TEMP)) @property def target_temperature(self): @@ -79,21 +79,21 @@ def target_temperature(self): temp = self._values.get(set_req.V_HVAC_SETPOINT_COOL) if temp is None: temp = self._values.get(set_req.V_HVAC_SETPOINT_HEAT) - return temp + return float(temp) @property def target_temperature_high(self): """Return the highbound target temperature we try to reach.""" set_req = self.gateway.const.SetReq if set_req.V_HVAC_SETPOINT_HEAT in self._values: - return self._values.get(set_req.V_HVAC_SETPOINT_COOL) + return float(self._values.get(set_req.V_HVAC_SETPOINT_COOL)) @property def target_temperature_low(self): """Return the lowbound target temperature we try to reach.""" set_req = self.gateway.const.SetReq if set_req.V_HVAC_SETPOINT_COOL in self._values: - return self._values.get(set_req.V_HVAC_SETPOINT_HEAT) + return float(self._values.get(set_req.V_HVAC_SETPOINT_HEAT)) @property def current_operation(self):