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/setup.py b/setup.py index e22de38e..6311805e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='ring_doorbell', packages=['ring_doorbell'], - version='0.1.8', + version='0.1.9', description='A Python library to communicate with Ring' + ' Door Bell (https://ring.com/)', author='Marcelo Moreira de Mello', 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