Fix temp not being reported properly (#28973)

pull/29060/head
shred86 2019-11-23 03:29:54 -08:00 committed by Pascal Vizeli
parent b4f477f4de
commit 0a58853689
1 changed files with 6 additions and 6 deletions

View File

@ -72,19 +72,19 @@ class AbodeSensor(AbodeDevice):
@property
def state(self):
"""Return the state of the sensor."""
if self._sensor_type == "temp":
if self._sensor_type == CONST.TEMP_STATUS_KEY:
return self._device.temp
if self._sensor_type == "humidity":
if self._sensor_type == CONST.HUMI_STATUS_KEY:
return self._device.humidity
if self._sensor_type == "lux":
if self._sensor_type == CONST.LUX_STATUS_KEY:
return self._device.lux
@property
def unit_of_measurement(self):
"""Return the units of measurement."""
if self._sensor_type == "temp":
if self._sensor_type == CONST.TEMP_STATUS_KEY:
return self._device.temp_unit
if self._sensor_type == "humidity":
if self._sensor_type == CONST.HUMI_STATUS_KEY:
return self._device.humidity_unit
if self._sensor_type == "lux":
if self._sensor_type == CONST.LUX_STATUS_KEY:
return self._device.lux_unit