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."""
|
||||
return CanaryOptionsFlowHandler(config_entry)
|
||||
|
||||
async def async_step_import(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
) -> ConfigFlowResult:
|
||||
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
|
||||
"""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(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
|
|
|
@ -129,11 +129,8 @@ class FileConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
"""Handle file sensor config flow."""
|
||||
return await self._async_handle_step(Platform.SENSOR.value, user_input)
|
||||
|
||||
async def async_step_import(
|
||||
self, import_data: dict[str, Any] | None = None
|
||||
) -> ConfigFlowResult:
|
||||
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
|
||||
"""Import `file`` config from configuration.yaml."""
|
||||
assert import_data is not None
|
||||
self._async_abort_entries_match(import_data)
|
||||
platform = import_data[CONF_PLATFORM]
|
||||
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)
|
||||
|
||||
async def async_step_import(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
) -> ConfigFlowResult:
|
||||
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
|
||||
"""Import user."""
|
||||
return await self.async_step_user(user_input)
|
||||
return await self.async_step_user(import_data)
|
||||
|
||||
@staticmethod
|
||||
@callback
|
||||
|
|
|
@ -30,7 +30,6 @@ from homeassistant.helpers.selector import (
|
|||
SelectSelector,
|
||||
SelectSelectorConfig,
|
||||
)
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
from .const import (
|
||||
CONF_CANDLE_LIGHT_MINUTES,
|
||||
|
@ -125,11 +124,9 @@ class JewishCalendarConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
),
|
||||
)
|
||||
|
||||
async def async_step_import(
|
||||
self, import_config: ConfigType | None
|
||||
) -> ConfigFlowResult:
|
||||
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
|
||||
"""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):
|
||||
|
|
|
@ -25,8 +25,6 @@ class MediaExtractorConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
return self.async_show_form(step_id="user", data_schema=vol.Schema({}))
|
||||
|
||||
async def async_step_import(
|
||||
self, import_config: dict[str, Any]
|
||||
) -> ConfigFlowResult:
|
||||
async def async_step_import(self, import_data: None) -> ConfigFlowResult:
|
||||
"""Handle import."""
|
||||
return self.async_create_entry(title="Media extractor", data={})
|
||||
|
|
|
@ -15,9 +15,7 @@ class ThreadConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
|
||||
VERSION = 1
|
||||
|
||||
async def async_step_import(
|
||||
self, import_data: dict[str, str] | None = None
|
||||
) -> ConfigFlowResult:
|
||||
async def async_step_import(self, import_data: None) -> ConfigFlowResult:
|
||||
"""Set up by import from async_setup."""
|
||||
await self._async_handle_discovery_without_unique_id()
|
||||
return self.async_create_entry(title="Thread", data={})
|
||||
|
|
|
@ -48,7 +48,7 @@ class ToonFlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
|
|||
return await self.async_step_agreement()
|
||||
|
||||
async def async_step_import(
|
||||
self, config: dict[str, Any] | None = None
|
||||
self, import_data: dict[str, Any] | None
|
||||
) -> ConfigFlowResult:
|
||||
"""Start a configuration flow based on imported data.
|
||||
|
||||
|
@ -57,8 +57,8 @@ class ToonFlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
|
|||
the version 1 schema.
|
||||
"""
|
||||
|
||||
if config is not None and CONF_MIGRATE in config:
|
||||
self.context.update({CONF_MIGRATE: config[CONF_MIGRATE]})
|
||||
if import_data is not None and CONF_MIGRATE in import_data:
|
||||
self.context.update({CONF_MIGRATE: import_data[CONF_MIGRATE]})
|
||||
else:
|
||||
await self._async_handle_discovery_without_unique_id()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue