Change how ring polls for changes to allow more platforms to be added (#25534)

* Add in a switch to control lights and sirens

* Improve the way sensors are updated

* fixes following flake8

* remove light platform, and fix breaking test.

* Resolve issues with tests

* add tests for the switch platform

* fix up flake8 errors

* fix the long strings

* fix naming on private method.

* updates following p/r

* further fixes following pr

* removed import

* add additional tests to improve code coverage

* forgot to check this in
This commit is contained in:
Ross Dargan authored and Paulus Schoutsen committed 2019-07-31 11:08:40 -07:00
1 parent 92991b53c4
commit 5e7465a261
9 files changed
+118 -38

No files matched your search

+8 -1
View File
@@ -3,7 +3,7 @@ from copy import deepcopy
import os
import unittest
import requests_mock
from datetime import timedelta
from homeassistant import setup
import homeassistant.components.ring as ring
@@ -16,6 +16,7 @@ VALID_CONFIG = {
"ring": {
"username": "foo",
"password": "bar",
"scan_interval": timedelta(10)
}
}
@@ -46,6 +47,12 @@ class TestRing(unittest.TestCase):
text=load_fixture('ring_oauth.json'))
mock.post('https://api.ring.com/clients_api/session',
text=load_fixture('ring_session.json'))
mock.get('https://api.ring.com/clients_api/ring_devices',
text=load_fixture('ring_devices.json'))
mock.get('https://api.ring.com/clients_api/chimes/999999/health',
text=load_fixture('ring_chime_health_attrs.json'))
mock.get('https://api.ring.com/clients_api/doorbots/987652/health',
text=load_fixture('ring_doorboot_health_attrs.json'))
response = ring.setup(self.hass, self.config)
assert response