This commit is contained in:
Michael Wyraz
2017-04-06 20:12:45 +02:00
parent 4cd4aae8a5
commit 4dc653ccba

View File

@@ -165,7 +165,7 @@ class MinMaxSensor(Entity):
@property @property
def state(self): def state(self):
"""Return the state of the sensor.""" """Return the state of the sensor."""
if (self._unit_of_measurement_mismatch): if self._unit_of_measurement_mismatch:
return STATE_UNKNOWN return STATE_UNKNOWN
return getattr(self, next( return getattr(self, next(
k for k, v in SENSOR_TYPES.items() if self._sensor_type == v)) k for k, v in SENSOR_TYPES.items() if self._sensor_type == v))
@@ -173,7 +173,7 @@ class MinMaxSensor(Entity):
@property @property
def unit_of_measurement(self): def unit_of_measurement(self):
"""Return the unit the value is expressed in.""" """Return the unit the value is expressed in."""
if (self._unit_of_measurement_mismatch): if self._unit_of_measurement_mismatch:
return "ERR" return "ERR"
return self._unit_of_measurement return self._unit_of_measurement