mirror of
https://github.com/home-assistant/core.git
synced 2025-05-03 21:49:17 +00:00

* Add config flow to manifest.json * Still load config flows via config flow platform * Fix typo * Lint * Update config_flows.py" * Catch import error when setting up entry * Lint * Fix tests * Fix imports * Lint * Fix Unifi tests * Fix translation test * Add homekit_controller config flow
25 lines
639 B
Python
25 lines
639 B
Python
"""Component to embed Google Cast."""
|
|
from homeassistant import config_entries
|
|
|
|
from .const import DOMAIN
|
|
|
|
|
|
async def async_setup(hass, config):
|
|
"""Set up the Cast component."""
|
|
conf = config.get(DOMAIN)
|
|
|
|
hass.data[DOMAIN] = conf or {}
|
|
|
|
if conf is not None:
|
|
hass.async_create_task(hass.config_entries.flow.async_init(
|
|
DOMAIN, context={'source': config_entries.SOURCE_IMPORT}))
|
|
|
|
return True
|
|
|
|
|
|
async def async_setup_entry(hass, entry):
|
|
"""Set up Cast from a config entry."""
|
|
hass.async_create_task(hass.config_entries.async_forward_entry_setup(
|
|
entry, 'media_player'))
|
|
return True
|