Upgrade Ring to new version (#30666)

* Upgrade Ring to new version

* Move legacy cleanup down

* Fix test
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-01-11 16:04:39 -08:00
1 parent 4972b249bf
commit 7073b0eb88
16 files changed
+121 -123

No files matched your search

+13 -4
View File
@@ -12,6 +12,7 @@ from . import (
DATA_RING_CHIMES,
DATA_RING_DOORBELLS,
DATA_RING_STICKUP_CAMS,
DOMAIN,
SIGNAL_UPDATE_RING,
)
@@ -108,6 +109,7 @@ class RingSensor(Entity):
self._disp_disconnect = async_dispatcher_connect(
self.hass, SIGNAL_UPDATE_RING, self._update_callback
)
await self.hass.async_add_executor_job(self._data.update)
async def async_will_remove_from_hass(self):
"""Disconnect callbacks."""
@@ -140,17 +142,24 @@ class RingSensor(Entity):
"""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["kind"] = self._data.kind
attrs["timezone"] = self._data.timezone
attrs["type"] = self._data.family
attrs["wifi_name"] = self._data.wifi_name
if self._extra and self._sensor_type.startswith("last_"):