Standardize import step variable name (part 3) (#124680)
This commit is contained in:
parent
831a1d7ad1
commit
68cdf8877c
7 changed files with 12 additions and 26 deletions
|
@ -54,11 +54,9 @@ class CanaryConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return CanaryOptionsFlowHandler(config_entry)
|
return CanaryOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
async def async_step_import(
|
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
|
||||||
self, user_input: dict[str, Any] | None = None
|
|
||||||
) -> ConfigFlowResult:
|
|
||||||
"""Handle a flow initiated by configuration file."""
|
"""Handle a flow initiated by configuration file."""
|
||||||
return await self.async_step_user(user_input)
|
return await self.async_step_user(import_data)
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
|
|
|
@ -129,11 +129,8 @@ class FileConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||||
"""Handle file sensor config flow."""
|
"""Handle file sensor config flow."""
|
||||||
return await self._async_handle_step(Platform.SENSOR.value, user_input)
|
return await self._async_handle_step(Platform.SENSOR.value, user_input)
|
||||||
|
|
||||||
async def async_step_import(
|
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
|
||||||
self, import_data: dict[str, Any] | None = None
|
|
||||||
) -> ConfigFlowResult:
|
|
||||||
"""Import `file`` config from configuration.yaml."""
|
"""Import `file`` config from configuration.yaml."""
|
||||||
assert import_data is not None
|
|
||||||
self._async_abort_entries_match(import_data)
|
self._async_abort_entries_match(import_data)
|
||||||
platform = import_data[CONF_PLATFORM]
|
platform = import_data[CONF_PLATFORM]
|
||||||
name: str = import_data.get(CONF_NAME, DEFAULT_NAME)
|
name: str = import_data.get(CONF_NAME, DEFAULT_NAME)
|
||||||
|
|
|
@ -163,11 +163,9 @@ class HiveFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||||
}
|
}
|
||||||
return await self.async_step_user(data)
|
return await self.async_step_user(data)
|
||||||
|
|
||||||
async def async_step_import(
|
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
|
||||||
self, user_input: dict[str, Any] | None = None
|
|
||||||
) -> ConfigFlowResult:
|
|
||||||
"""Import user."""
|
"""Import user."""
|
||||||
return await self.async_step_user(user_input)
|
return await self.async_step_user(import_data)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
|
|
|
@ -30,7 +30,6 @@ from homeassistant.helpers.selector import (
|
||||||
SelectSelector,
|
SelectSelector,
|
||||||
SelectSelectorConfig,
|
SelectSelectorConfig,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers.typing import ConfigType
|
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
CONF_CANDLE_LIGHT_MINUTES,
|
CONF_CANDLE_LIGHT_MINUTES,
|
||||||
|
@ -125,11 +124,9 @@ class JewishCalendarConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_import(
|
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
|
||||||
self, import_config: ConfigType | None
|
|
||||||
) -> ConfigFlowResult:
|
|
||||||
"""Import a config entry from configuration.yaml."""
|
"""Import a config entry from configuration.yaml."""
|
||||||
return await self.async_step_user(import_config)
|
return await self.async_step_user(import_data)
|
||||||
|
|
||||||
|
|
||||||
class JewishCalendarOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
class JewishCalendarOptionsFlowHandler(OptionsFlowWithConfigEntry):
|
||||||
|
|
|
@ -25,8 +25,6 @@ class MediaExtractorConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
return self.async_show_form(step_id="user", data_schema=vol.Schema({}))
|
return self.async_show_form(step_id="user", data_schema=vol.Schema({}))
|
||||||
|
|
||||||
async def async_step_import(
|
async def async_step_import(self, import_data: None) -> ConfigFlowResult:
|
||||||
self, import_config: dict[str, Any]
|
|
||||||
) -> ConfigFlowResult:
|
|
||||||
"""Handle import."""
|
"""Handle import."""
|
||||||
return self.async_create_entry(title="Media extractor", data={})
|
return self.async_create_entry(title="Media extractor", data={})
|
||||||
|
|
|
@ -15,9 +15,7 @@ class ThreadConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
|
||||||
async def async_step_import(
|
async def async_step_import(self, import_data: None) -> ConfigFlowResult:
|
||||||
self, import_data: dict[str, str] | None = None
|
|
||||||
) -> ConfigFlowResult:
|
|
||||||
"""Set up by import from async_setup."""
|
"""Set up by import from async_setup."""
|
||||||
await self._async_handle_discovery_without_unique_id()
|
await self._async_handle_discovery_without_unique_id()
|
||||||
return self.async_create_entry(title="Thread", data={})
|
return self.async_create_entry(title="Thread", data={})
|
||||||
|
|
|
@ -48,7 +48,7 @@ class ToonFlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
|
||||||
return await self.async_step_agreement()
|
return await self.async_step_agreement()
|
||||||
|
|
||||||
async def async_step_import(
|
async def async_step_import(
|
||||||
self, config: dict[str, Any] | None = None
|
self, import_data: dict[str, Any] | None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Start a configuration flow based on imported data.
|
"""Start a configuration flow based on imported data.
|
||||||
|
|
||||||
|
@ -57,8 +57,8 @@ class ToonFlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
|
||||||
the version 1 schema.
|
the version 1 schema.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if config is not None and CONF_MIGRATE in config:
|
if import_data is not None and CONF_MIGRATE in import_data:
|
||||||
self.context.update({CONF_MIGRATE: config[CONF_MIGRATE]})
|
self.context.update({CONF_MIGRATE: import_data[CONF_MIGRATE]})
|
||||||
else:
|
else:
|
||||||
await self._async_handle_discovery_without_unique_id()
|
await self._async_handle_discovery_without_unique_id()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue