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

@ -100,6 +100,7 @@ class RingSensor(Entity):
self._data.name, SENSOR_TYPES.get(self._sensor_type)[0])
self._state = STATE_UNKNOWN
self._tz = str(hass.config.time_zone)
self._unique_id = '{}-{}'.format(self._data.id, self._sensor_type)
@property
def name(self):
@ -111,6 +112,11 @@ class RingSensor(Entity):
"""Return the state of the sensor."""
return self._state
@property
def unique_id(self):
"""Return a unique ID."""
return self._unique_id
@property
def device_state_attributes(self):
"""Return the state attributes."""