Fix ecobee binary sensor and sensor unique ids (#27208)

* Fix sensor unique id

* Fix binary sensor unique id
pull/27374/head
Mark Coombes 2019-10-04 17:15:43 -04:00 committed by Paulus Schoutsen
parent 756e22290d
commit 33da7d341d
2 changed files with 4 additions and 2 deletions

View File

@ -50,7 +50,8 @@ class EcobeeBinarySensor(BinarySensorDevice):
if sensor["name"] == self.sensor_name:
if "code" in sensor:
return f"{sensor['code']}-{self.device_class}"
return f"{sensor['id']}-{self.device_class}"
thermostat = self.data.ecobee.get_thermostat(self.index)
return f"{thermostat['identifier']}-{sensor['id']}-{self.device_class}"
@property
def is_on(self):

View File

@ -61,7 +61,8 @@ class EcobeeSensor(Entity):
if sensor["name"] == self.sensor_name:
if "code" in sensor:
return f"{sensor['code']}-{self.device_class}"
return f"{sensor['id']}-{self.device_class}"
thermostat = self.data.ecobee.get_thermostat(self.index)
return f"{thermostat['identifier']}-{sensor['id']}-{self.device_class}"
@property
def device_class(self):