1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

Add Ring config flow (#30564)

* Add Ring config flow

* Address comments + migrate platforms to config entry

* Migrate camera too

* Address comments

* Fix order config flows

* setup -> async_setup
This commit is contained in:
Paulus Schoutsen
2020-01-10 21:35:31 +01:00
committed by GitHub
parent 3348f4f6d1
commit 3f29c234b8
17 changed files with 435 additions and 146 deletions

View File

@@ -1,14 +1,15 @@
"""Common methods used across the tests for ring devices."""
from unittest.mock import patch
from homeassistant.components.ring import DOMAIN
from homeassistant.const import CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_USERNAME
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry
async def setup_platform(hass, platform):
"""Set up the ring platform and prerequisites."""
config = {
DOMAIN: {CONF_USERNAME: "foo", CONF_PASSWORD: "bar", CONF_SCAN_INTERVAL: 1000},
platform: {"platform": DOMAIN},
}
assert await async_setup_component(hass, platform, config)
MockConfigEntry(domain=DOMAIN, data={"username": "foo"}).add_to_hass(hass)
with patch("homeassistant.components.ring.PLATFORMS", [platform]):
assert await async_setup_component(hass, DOMAIN, {})
await hass.async_block_till_done()