mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 14:45:09 +02:00
pass configuration to import step
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
"""The Samsung TV integration."""
|
"""The Samsung TV integration."""
|
||||||
from wakeonlan import BROADCAST_IP
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
from wakeonlan import BROADCAST_IP
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_BROADCAST_ADDRESS,
|
CONF_BROADCAST_ADDRESS,
|
||||||
@@ -14,7 +14,6 @@ import homeassistant.helpers.config_validation as cv
|
|||||||
|
|
||||||
from .const import DEFAULT_NAME, DEFAULT_TIMEOUT, DOMAIN
|
from .const import DEFAULT_NAME, DEFAULT_TIMEOUT, DOMAIN
|
||||||
|
|
||||||
|
|
||||||
CONFIG_SCHEMA = vol.Schema(
|
CONFIG_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
DOMAIN: vol.All(
|
DOMAIN: vol.All(
|
||||||
@@ -45,7 +44,7 @@ async def async_setup(hass, config):
|
|||||||
if DOMAIN in config:
|
if DOMAIN in config:
|
||||||
for entry_config in config[DOMAIN]:
|
for entry_config in config[DOMAIN]:
|
||||||
await hass.config_entries.flow.async_init(
|
await hass.config_entries.flow.async_init(
|
||||||
DOMAIN, context={"source": "user"}, data=entry_config
|
DOMAIN, context={"source": "import"}, data=entry_config
|
||||||
)
|
)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
@@ -116,6 +116,10 @@ class SamsungTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
async def async_step_import(self, user_input=None):
|
||||||
|
"""Handle configuration by yaml file."""
|
||||||
|
return await self.async_step_user(user_input)
|
||||||
|
|
||||||
async def async_step_user(self, user_input=None):
|
async def async_step_user(self, user_input=None):
|
||||||
"""Handle a flow initialized by the user."""
|
"""Handle a flow initialized by the user."""
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
|
Reference in New Issue
Block a user