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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user