mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Add unique_id for Ring (#17497)
This commit is contained in:
parent
a9389d2d43
commit
dc7e5e3af4
@ -73,6 +73,7 @@ class RingBinarySensor(BinarySensorDevice):
|
|||||||
SENSOR_TYPES.get(self._sensor_type)[0])
|
SENSOR_TYPES.get(self._sensor_type)[0])
|
||||||
self._device_class = SENSOR_TYPES.get(self._sensor_type)[2]
|
self._device_class = SENSOR_TYPES.get(self._sensor_type)[2]
|
||||||
self._state = None
|
self._state = None
|
||||||
|
self._unique_id = '{}-{}'.format(self._data.id, self._sensor_type)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -89,6 +90,11 @@ class RingBinarySensor(BinarySensorDevice):
|
|||||||
"""Return the class of the binary sensor."""
|
"""Return the class of the binary sensor."""
|
||||||
return self._device_class
|
return self._device_class
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return a unique ID."""
|
||||||
|
return self._unique_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
|
@ -97,6 +97,11 @@ class RingCam(Camera):
|
|||||||
"""Return the name of this camera."""
|
"""Return the name of this camera."""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return a unique ID."""
|
||||||
|
return self._camera.id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
|
@ -100,6 +100,7 @@ class RingSensor(Entity):
|
|||||||
self._data.name, SENSOR_TYPES.get(self._sensor_type)[0])
|
self._data.name, SENSOR_TYPES.get(self._sensor_type)[0])
|
||||||
self._state = STATE_UNKNOWN
|
self._state = STATE_UNKNOWN
|
||||||
self._tz = str(hass.config.time_zone)
|
self._tz = str(hass.config.time_zone)
|
||||||
|
self._unique_id = '{}-{}'.format(self._data.id, self._sensor_type)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -111,6 +112,11 @@ class RingSensor(Entity):
|
|||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return a unique ID."""
|
||||||
|
return self._unique_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user