Upgrade Ring to new version (#30666)
* Upgrade Ring to new version * Move legacy cleanup down * Fix test
This commit is contained in:
1 parent
86bdba2ea2
commit
718f3438ea
16 files changed
+121
-123
No files matched your search
@@ -5,7 +5,7 @@ import logging
|
||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||
from homeassistant.const import ATTR_ATTRIBUTION
|
||||
|
||||
from . import ATTRIBUTION, DATA_RING_DOORBELLS, DATA_RING_STICKUP_CAMS
|
||||
from . import ATTRIBUTION, DATA_RING_DOORBELLS, DATA_RING_STICKUP_CAMS, DOMAIN
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -72,14 +72,23 @@ class RingBinarySensor(BinarySensorDevice):
|
||||
"""Return a unique ID."""
|
||||
return self._unique_id
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
"""Return device info."""
|
||||
return {
|
||||
"identifiers": {(DOMAIN, self._data.id)},
|
||||
"sw_version": self._data.firmware,
|
||||
"name": self._data.name,
|
||||
"model": self._data.kind,
|
||||
"manufacturer": "Ring",
|
||||
}
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
attrs = {}
|
||||
attrs[ATTR_ATTRIBUTION] = ATTRIBUTION
|
||||
|
||||
attrs["device_id"] = self._data.id
|
||||
attrs["firmware"] = self._data.firmware
|
||||
attrs["timezone"] = self._data.timezone
|
||||
|
||||
if self._data.alert and self._data.alert_expires_at:
|
||||
|
||||
Reference in new issue
Block a user