diff --git a/homeassistant/components/ring.py b/homeassistant/components/ring.py index 1a15e22fca0..3bfa1372fab 100644 --- a/homeassistant/components/ring.py +++ b/homeassistant/components/ring.py @@ -12,7 +12,7 @@ import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.const import CONF_USERNAME, CONF_PASSWORD -REQUIREMENTS = ['ring_doorbell==0.1.8'] +REQUIREMENTS = ['ring_doorbell==0.2.1'] _LOGGER = logging.getLogger(__name__) diff --git a/requirements_all.txt b/requirements_all.txt index 921bbf8fd46..8d31dd7e267 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1189,7 +1189,7 @@ restrictedpython==4.0b4 rflink==0.0.37 # homeassistant.components.ring -ring_doorbell==0.1.8 +ring_doorbell==0.2.1 # homeassistant.components.notify.rocketchat rocketchat-API==0.6.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 02f079dd9a6..1b32efe9577 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -180,7 +180,7 @@ restrictedpython==4.0b4 rflink==0.0.37 # homeassistant.components.ring -ring_doorbell==0.1.8 +ring_doorbell==0.2.1 # homeassistant.components.media_player.yamaha rxv==0.5.1 diff --git a/tests/components/binary_sensor/test_ring.py b/tests/components/binary_sensor/test_ring.py index 889282b56dd..e557050ae48 100644 --- a/tests/components/binary_sensor/test_ring.py +++ b/tests/components/binary_sensor/test_ring.py @@ -44,6 +44,8 @@ class TestRingBinarySensorSetup(unittest.TestCase): @requests_mock.Mocker() def test_binary_sensor(self, mock): """Test the Ring sensor class and methods.""" + mock.post('https://oauth.ring.com/oauth/token', + 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', diff --git a/tests/components/sensor/test_ring.py b/tests/components/sensor/test_ring.py index 0cce0ea681d..4d34018ce52 100644 --- a/tests/components/sensor/test_ring.py +++ b/tests/components/sensor/test_ring.py @@ -51,6 +51,8 @@ class TestRingSensorSetup(unittest.TestCase): @requests_mock.Mocker() def test_sensor(self, mock): """Test the Ring sensor class and methods.""" + mock.post('https://oauth.ring.com/oauth/token', + 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', diff --git a/tests/components/test_ring.py b/tests/components/test_ring.py index 3837ec13061..7b974686a4e 100644 --- a/tests/components/test_ring.py +++ b/tests/components/test_ring.py @@ -42,6 +42,8 @@ class TestRing(unittest.TestCase): @requests_mock.Mocker() def test_setup(self, mock): """Test the setup.""" + mock.post('https://oauth.ring.com/oauth/token', + text=load_fixture('ring_oauth.json')) mock.post('https://api.ring.com/clients_api/session', text=load_fixture('ring_session.json')) response = ring.setup(self.hass, self.config) diff --git a/tests/fixtures/ring_oauth.json b/tests/fixtures/ring_oauth.json new file mode 100644 index 00000000000..5e69ddde065 --- /dev/null +++ b/tests/fixtures/ring_oauth.json @@ -0,0 +1,8 @@ +{ + "access_token": "eyJ0eWfvEQwqfJNKyQ9999", + "token_type": "bearer", + "expires_in": 3600, + "refresh_token": "67695a26bdefc1ac8999", + "scope": "client", + "created_at": 1529099870 +}