Remove YAML configuration from Local IP (#50642)
This commit is contained in:
parent
117860f13b
commit
c9b25fe2a2
3 changed files with 9 additions and 40 deletions
|
@ -1,35 +1,11 @@
|
|||
"""Get the local IP address of the Home Assistant instance."""
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
||||
from homeassistant.const import CONF_NAME
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from .const import DOMAIN, PLATFORMS
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema(
|
||||
{
|
||||
DOMAIN: vol.All(
|
||||
cv.deprecated(CONF_NAME),
|
||||
vol.Schema({vol.Optional(CONF_NAME, default=DOMAIN): cv.string}),
|
||||
)
|
||||
},
|
||||
extra=vol.ALLOW_EXTRA,
|
||||
)
|
||||
|
||||
|
||||
async def async_setup(hass: HomeAssistant, config: dict):
|
||||
"""Set up local_ip from configuration.yaml."""
|
||||
conf = config.get(DOMAIN)
|
||||
if conf:
|
||||
hass.async_create_task(
|
||||
hass.config_entries.flow.async_init(
|
||||
DOMAIN, data=conf, context={"source": SOURCE_IMPORT}
|
||||
)
|
||||
)
|
||||
|
||||
return True
|
||||
CONFIG_SCHEMA = cv.deprecated(DOMAIN)
|
||||
|
||||
|
||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
||||
|
|
|
@ -20,7 +20,3 @@ class SimpleConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
return self.async_show_form(step_id="user")
|
||||
|
||||
return self.async_create_entry(title=DOMAIN, data=user_input)
|
||||
|
||||
async def async_step_import(self, import_info):
|
||||
"""Handle import from config file."""
|
||||
return await self.async_step_user(import_info)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue