Add unique_id for Ring (#17497)

This commit is contained in:
Daniel Shokouhi authored and Paulus Schoutsen committed 2018-10-16 10:06:00 +02:00
1 parent a9389d2d43
commit dc7e5e3af4
3 files changed
+17

No files matched your search

@@ -73,6 +73,7 @@ class RingBinarySensor(BinarySensorDevice):
SENSOR_TYPES.get(self._sensor_type)[0])
self._device_class = SENSOR_TYPES.get(self._sensor_type)[2]
self._state = None
self._unique_id = '{}-{}'.format(self._data.id, self._sensor_type)
@property
def name(self):
@@ -89,6 +90,11 @@ class RingBinarySensor(BinarySensorDevice):
"""Return the class of the binary sensor."""
return self._device_class
@property
def unique_id(self):
"""Return a unique ID."""
return self._unique_id
@property
def device_state_attributes(self):
"""Return the state attributes."""