Check for 'unknown' sensor values in ecobee (#1983)

pull/1662/merge
Nolan Gilley 2016-05-06 21:50:32 -04:00 committed by Paulus Schoutsen
parent b86a1ece01
commit fb3b3db04e
1 changed files with 6 additions and 14 deletions

View File

@ -78,18 +78,10 @@ class EcobeeSensor(Entity):
data.update()
for sensor in data.ecobee.get_remote_sensors(self.index):
for item in sensor['capability']:
if (
item['type'] == self.type and
self.type == 'temperature' and
if (item['type'] == self.type and
self.sensor_name == sensor['name']):
self._state = float(item['value']) / 10
elif (
item['type'] == self.type and
self.type == 'humidity' and
self.sensor_name == sensor['name']):
self._state = item['value']
elif (
item['type'] == self.type and
self.type == 'occupancy' and
self.sensor_name == sensor['name']):
self._state = item['value']
if (self.type == 'temperature' and
item['value'] != 'unknown'):
self._state = float(item['value']) / 10
else:
self._state = item['value']