diff --git a/ring_doorbell/__init__.py b/ring_doorbell/__init__.py index cdb90044..9e18f0a2 100644 --- a/ring_doorbell/__init__.py +++ b/ring_doorbell/__init__.py @@ -253,3 +253,12 @@ def stickup_cams(self): def doorbells(self): """Return a list of RingDoorBell objects.""" return self.__devices('doorbells') + + def update(self): + """Refreshes attributes for all linked devices.""" + for device_lst in self.devices.values(): + for device in device_lst: + if hasattr(device, "update"): + _LOGGER.debug("Updating attributes from %s", device.name) + getattr(device, "update") + return True diff --git a/tests/test_base.py b/tests/test_base.py index dcb4979f..8a18f8cf 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -28,6 +28,8 @@ def setUp(self, mock): self.ring_persistent = \ Ring(USERNAME, PASSWORD, cache_file=CACHE, persist_token=True) + self.assertTrue(hasattr(self.ring, "update")) + def cleanup(self): """Cleanup any data created from the tests.""" self.ring = None