From c16a29b930522bafd7b02cba71a41f42f9f1a77f Mon Sep 17 00:00:00 2001 From: John Arild Berentsen Date: Sun, 14 Aug 2016 10:19:54 +0200 Subject: [PATCH] Fix unknown unit of measurement for hvac and thermostat component (#2816) * Fix unknown unit of measurement for hvac and thermostat component * Simplify --- homeassistant/components/hvac/zwave.py | 5 +++-- homeassistant/components/thermostat/zwave.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/hvac/zwave.py b/homeassistant/components/hvac/zwave.py index 2747cc8eb32..f8cb3fa5c9e 100755 --- a/homeassistant/components/hvac/zwave.py +++ b/homeassistant/components/hvac/zwave.py @@ -120,8 +120,9 @@ class ZWaveHvac(ZWaveDeviceEntity, HvacDevice): # Current Temp for value in self._node.get_values( class_id=COMMAND_CLASS_SENSOR_MULTILEVEL).values(): - self._current_temperature = int(value.data) - self._unit = value.units + if value.label == 'Temperature': + self._current_temperature = int(value.data) + self._unit = value.units # Fan Mode for value in self._node.get_values( class_id=COMMAND_CLASS_THERMOSTAT_FAN_MODE).values(): diff --git a/homeassistant/components/thermostat/zwave.py b/homeassistant/components/thermostat/zwave.py index 80766d47100..bd5e5d04b58 100644 --- a/homeassistant/components/thermostat/zwave.py +++ b/homeassistant/components/thermostat/zwave.py @@ -91,8 +91,9 @@ class ZWaveThermostat(zwave.ZWaveDeviceEntity, ThermostatDevice): # current Temp for _, value in self._node.get_values_for_command_class( COMMAND_CLASS_SENSOR_MULTILEVEL).items(): - self._current_temperature = int(value.data) - self._unit = value.units + if value.label == 'Temperature': + self._current_temperature = int(value.data) + self._unit = value.units # operation state for _, value in self._node.get_values(