Use COMMAND_CLASS_THERMOSTAT_SETPOINT to get unit_of_measurement instad of COMMAND_CLASS_SENSOR_MULTILEVEL. Not all devices have multilevel sensor. (#3003)

pull/2991/head
John Arild Berentsen 2016-08-27 13:39:22 +02:00 committed by GitHub
parent 04f0fec352
commit f863efdaca
1 changed files with 1 additions and 1 deletions

View File

@ -110,6 +110,7 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
temps = []
for value in self._node.get_values(
class_id=COMMAND_CLASS_THERMOSTAT_SETPOINT).values():
self._unit = value.units
temps.append(int(value.data))
if value.index == self._index:
self._target_temperature = int(value.data)
@ -128,7 +129,6 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
class_id=COMMAND_CLASS_SENSOR_MULTILEVEL).values():
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():