diff --git a/ring_doorbell/__init__.py b/ring_doorbell/__init__.py index 1de6f4d1..62474b9a 100644 --- a/ring_doorbell/__init__.py +++ b/ring_doorbell/__init__.py @@ -653,3 +653,8 @@ def volume(self, value): self._ring.query(url, extra_params=params, method='PUT') self.update() return True + + @property + def connection_status(self): + """Return connection status.""" + return self._attrs.get('alerts').get('connection') diff --git a/tests/test_ring.py b/tests/test_ring.py index f3edbb2c..87f3d553 100644 --- a/tests/test_ring.py +++ b/tests/test_ring.py @@ -304,6 +304,7 @@ def test_doorbell_attributes(self, get_mock, post_mock): self.assertEqual(-70.12345, dev.longitude) self.assertEqual('America/New_York', dev.timezone) self.assertEqual(1, dev.volume) + self.assertEqual('online', dev.connection_status) self.assertIsInstance(dev.history(limit=1, kind='motion'), list)