Add unique_id for Ring (#17497)

This commit is contained in:
Daniel Shokouhi 2018-10-16 01:06:00 -07:00 committed by Paulus Schoutsen
parent a9389d2d43
commit dc7e5e3af4
3 changed files with 17 additions and 0 deletions

View file

@ -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."""