2019-08-06 12:39:07 +00:00
|
|
|
"""Common methods used across the tests for ring devices."""
|
|
|
|
from homeassistant.components.ring import DOMAIN
|
|
|
|
from homeassistant.setup import async_setup_component
|
|
|
|
|
2020-05-03 18:27:19 +00:00
|
|
|
from tests.async_mock import patch
|
2020-01-10 20:35:31 +00:00
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
2019-08-06 12:39:07 +00:00
|
|
|
|
|
|
|
async def setup_platform(hass, platform):
|
|
|
|
"""Set up the ring platform and prerequisites."""
|
2020-01-12 00:04:39 +00:00
|
|
|
MockConfigEntry(domain=DOMAIN, data={"username": "foo", "token": {}}).add_to_hass(
|
|
|
|
hass
|
|
|
|
)
|
2020-01-10 20:35:31 +00:00
|
|
|
with patch("homeassistant.components.ring.PLATFORMS", [platform]):
|
|
|
|
assert await async_setup_component(hass, DOMAIN, {})
|
2019-08-06 12:39:07 +00:00
|
|
|
await hass.async_block_till_done()
|