diff --git a/homeassistant/components/abode/config_flow.py b/homeassistant/components/abode/config_flow.py index 1cbab2bdbe4..4c3d44bebbe 100644 --- a/homeassistant/components/abode/config_flow.py +++ b/homeassistant/components/abode/config_flow.py @@ -150,9 +150,9 @@ class AbodeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): return await self._async_abode_mfa_login() - async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle reauthorization request from Abode.""" - self._username = config[CONF_USERNAME] + self._username = entry_data[CONF_USERNAME] return await self.async_step_reauth_confirm() diff --git a/homeassistant/components/airvisual/config_flow.py b/homeassistant/components/airvisual/config_flow.py index 516b8906092..f97616c38fc 100644 --- a/homeassistant/components/airvisual/config_flow.py +++ b/homeassistant/components/airvisual/config_flow.py @@ -221,10 +221,10 @@ class AirVisualFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): data={**user_input, CONF_INTEGRATION_TYPE: INTEGRATION_TYPE_NODE_PRO}, ) - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" - self._entry_data_for_reauth = data - self._geo_id = async_get_geography_id(data) + self._entry_data_for_reauth = entry_data + self._geo_id = async_get_geography_id(entry_data) return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( diff --git a/homeassistant/components/aussie_broadband/config_flow.py b/homeassistant/components/aussie_broadband/config_flow.py index 37de59d4767..c71570b73fb 100644 --- a/homeassistant/components/aussie_broadband/config_flow.py +++ b/homeassistant/components/aussie_broadband/config_flow.py @@ -77,9 +77,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): errors=errors, ) - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle reauth on credential failure.""" - self._reauth_username = data[CONF_USERNAME] + self._reauth_username = entry_data[CONF_USERNAME] return await self.async_step_reauth_confirm() diff --git a/homeassistant/components/axis/config_flow.py b/homeassistant/components/axis/config_flow.py index 2c5239a8fb3..f94c27dc2ac 100644 --- a/homeassistant/components/axis/config_flow.py +++ b/homeassistant/components/axis/config_flow.py @@ -139,18 +139,18 @@ class AxisFlowHandler(config_entries.ConfigFlow, domain=AXIS_DOMAIN): title = f"{model} - {serial}" return self.async_create_entry(title=title, data=self.device_config) - async def async_step_reauth(self, device_config: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Trigger a reauthentication flow.""" self.context["title_placeholders"] = { - CONF_NAME: device_config[CONF_NAME], - CONF_HOST: device_config[CONF_HOST], + CONF_NAME: entry_data[CONF_NAME], + CONF_HOST: entry_data[CONF_HOST], } self.discovery_schema = { - vol.Required(CONF_HOST, default=device_config[CONF_HOST]): str, - vol.Required(CONF_USERNAME, default=device_config[CONF_USERNAME]): str, + vol.Required(CONF_HOST, default=entry_data[CONF_HOST]): str, + vol.Required(CONF_USERNAME, default=entry_data[CONF_USERNAME]): str, vol.Required(CONF_PASSWORD): str, - vol.Required(CONF_PORT, default=device_config[CONF_PORT]): int, + vol.Required(CONF_PORT, default=entry_data[CONF_PORT]): int, } return await self.async_step_user() diff --git a/homeassistant/components/deconz/config_flow.py b/homeassistant/components/deconz/config_flow.py index 6e2a286c168..d94b40e8525 100644 --- a/homeassistant/components/deconz/config_flow.py +++ b/homeassistant/components/deconz/config_flow.py @@ -205,12 +205,12 @@ class DeconzFlowHandler(ConfigFlow, domain=DOMAIN): }, ) - async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Trigger a reauthentication flow.""" - self.context["title_placeholders"] = {CONF_HOST: config[CONF_HOST]} + self.context["title_placeholders"] = {CONF_HOST: entry_data[CONF_HOST]} - self.host = config[CONF_HOST] - self.port = config[CONF_PORT] + self.host = entry_data[CONF_HOST] + self.port = entry_data[CONF_PORT] return await self.async_step_link() diff --git a/homeassistant/components/devolo_home_control/config_flow.py b/homeassistant/components/devolo_home_control/config_flow.py index fc1689e0742..aef9592d2e9 100644 --- a/homeassistant/components/devolo_home_control/config_flow.py +++ b/homeassistant/components/devolo_home_control/config_flow.py @@ -68,14 +68,14 @@ class DevoloHomeControlFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): step_id="zeroconf_confirm", errors={"base": "invalid_auth"} ) - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle reauthentication.""" self._reauth_entry = self.hass.config_entries.async_get_entry( self.context["entry_id"] ) - self._url = data[CONF_MYDEVOLO] + self._url = entry_data[CONF_MYDEVOLO] self.data_schema = { - vol.Required(CONF_USERNAME, default=data[CONF_USERNAME]): str, + vol.Required(CONF_USERNAME, default=entry_data[CONF_USERNAME]): str, vol.Required(CONF_PASSWORD): str, } return await self.async_step_reauth_confirm() diff --git a/homeassistant/components/fritz/config_flow.py b/homeassistant/components/fritz/config_flow.py index afb1708cac1..ddc09cb73a9 100644 --- a/homeassistant/components/fritz/config_flow.py +++ b/homeassistant/components/fritz/config_flow.py @@ -231,13 +231,13 @@ class FritzBoxToolsFlowHandler(ConfigFlow, domain=DOMAIN): return self._async_create_entry() - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle flow upon an API authentication error.""" self._entry = self.hass.config_entries.async_get_entry(self.context["entry_id"]) - self._host = data[CONF_HOST] - self._port = data[CONF_PORT] - self._username = data[CONF_USERNAME] - self._password = data[CONF_PASSWORD] + self._host = entry_data[CONF_HOST] + self._port = entry_data[CONF_PORT] + self._username = entry_data[CONF_USERNAME] + self._password = entry_data[CONF_PASSWORD] return await self.async_step_reauth_confirm() def _show_setup_form_reauth_confirm( diff --git a/homeassistant/components/fritzbox/config_flow.py b/homeassistant/components/fritzbox/config_flow.py index d183c4a8d5e..b4e86b92568 100644 --- a/homeassistant/components/fritzbox/config_flow.py +++ b/homeassistant/components/fritzbox/config_flow.py @@ -176,14 +176,14 @@ class FritzboxConfigFlow(ConfigFlow, domain=DOMAIN): errors=errors, ) - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Trigger a reauthentication flow.""" entry = self.hass.config_entries.async_get_entry(self.context["entry_id"]) assert entry is not None self._entry = entry - self._host = data[CONF_HOST] - self._name = str(data[CONF_HOST]) - self._username = data[CONF_USERNAME] + self._host = entry_data[CONF_HOST] + self._name = str(entry_data[CONF_HOST]) + self._username = entry_data[CONF_USERNAME] return await self.async_step_reauth_confirm() diff --git a/homeassistant/components/meater/config_flow.py b/homeassistant/components/meater/config_flow.py index 8d5e459fbce..91a927a5fb2 100644 --- a/homeassistant/components/meater/config_flow.py +++ b/homeassistant/components/meater/config_flow.py @@ -45,10 +45,10 @@ class MeaterConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return await self._try_connect_meater("user", None, username, password) - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" self._data_schema = REAUTH_SCHEMA - self._username = data[CONF_USERNAME] + self._username = entry_data[CONF_USERNAME] return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( diff --git a/homeassistant/components/nam/config_flow.py b/homeassistant/components/nam/config_flow.py index 451148c22fe..3dc2d7f0ba0 100644 --- a/homeassistant/components/nam/config_flow.py +++ b/homeassistant/components/nam/config_flow.py @@ -190,11 +190,11 @@ class NAMFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): errors=errors, ) - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" if entry := self.hass.config_entries.async_get_entry(self.context["entry_id"]): self.entry = entry - self.host = data[CONF_HOST] + self.host = entry_data[CONF_HOST] self.context["title_placeholders"] = {"host": self.host} return await self.async_step_reauth_confirm() diff --git a/homeassistant/components/nanoleaf/config_flow.py b/homeassistant/components/nanoleaf/config_flow.py index eb8bbb1ec66..cab6c8003d0 100644 --- a/homeassistant/components/nanoleaf/config_flow.py +++ b/homeassistant/components/nanoleaf/config_flow.py @@ -78,13 +78,15 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): ) return await self.async_step_link() - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle Nanoleaf reauth flow if token is invalid.""" self.reauth_entry = cast( config_entries.ConfigEntry, self.hass.config_entries.async_get_entry(self.context["entry_id"]), ) - self.nanoleaf = Nanoleaf(async_get_clientsession(self.hass), data[CONF_HOST]) + self.nanoleaf = Nanoleaf( + async_get_clientsession(self.hass), entry_data[CONF_HOST] + ) self.context["title_placeholders"] = {"name": self.reauth_entry.title} return await self.async_step_link() diff --git a/homeassistant/components/nest/config_flow.py b/homeassistant/components/nest/config_flow.py index 2e89f7970fa..1288592be74 100644 --- a/homeassistant/components/nest/config_flow.py +++ b/homeassistant/components/nest/config_flow.py @@ -218,10 +218,10 @@ class NestFlowHandler( return await self.async_step_finish() return await self.async_step_pubsub() - async def async_step_reauth(self, user_input: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Perform reauth upon an API authentication error.""" assert self.config_mode != ConfigMode.LEGACY, "Step only supported for SDM API" - self._data.update(user_input) + self._data.update(entry_data) return await self.async_step_reauth_confirm() diff --git a/homeassistant/components/notion/config_flow.py b/homeassistant/components/notion/config_flow.py index 56093067711..917c0f8ebb9 100644 --- a/homeassistant/components/notion/config_flow.py +++ b/homeassistant/components/notion/config_flow.py @@ -74,9 +74,9 @@ class NotionFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): return self.async_create_entry(title=self._username, data=data) - async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" - self._username = config[CONF_USERNAME] + self._username = entry_data[CONF_USERNAME] return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( diff --git a/homeassistant/components/overkiz/config_flow.py b/homeassistant/components/overkiz/config_flow.py index c70a551f4c7..2808c309938 100644 --- a/homeassistant/components/overkiz/config_flow.py +++ b/homeassistant/components/overkiz/config_flow.py @@ -155,7 +155,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return await self.async_step_user() - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle reauth.""" self._config_entry = cast( ConfigEntry, @@ -169,4 +169,4 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): self._default_user = self._config_entry.data[CONF_USERNAME] self._default_hub = self._config_entry.data[CONF_HUB] - return await self.async_step_user(dict(data)) + return await self.async_step_user(dict(entry_data)) diff --git a/homeassistant/components/renault/config_flow.py b/homeassistant/components/renault/config_flow.py index 539ba7549b3..8f5b99972d1 100644 --- a/homeassistant/components/renault/config_flow.py +++ b/homeassistant/components/renault/config_flow.py @@ -93,9 +93,9 @@ class RenaultFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): ), ) - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Perform reauth upon an API authentication error.""" - self._original_data = data + self._original_data = entry_data return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( diff --git a/homeassistant/components/ridwell/config_flow.py b/homeassistant/components/ridwell/config_flow.py index 2d6444fede9..722c20336d4 100644 --- a/homeassistant/components/ridwell/config_flow.py +++ b/homeassistant/components/ridwell/config_flow.py @@ -81,9 +81,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): data={CONF_USERNAME: self._username, CONF_PASSWORD: self._password}, ) - async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" - self._username = config[CONF_USERNAME] + self._username = entry_data[CONF_USERNAME] return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( diff --git a/homeassistant/components/simplisafe/config_flow.py b/homeassistant/components/simplisafe/config_flow.py index 3fcab1f3966..0b95de2c186 100644 --- a/homeassistant/components/simplisafe/config_flow.py +++ b/homeassistant/components/simplisafe/config_flow.py @@ -98,16 +98,16 @@ class SimpliSafeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): """Define the config flow to handle options.""" return SimpliSafeOptionsFlowHandler(config_entry) - async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" self._reauth = True - if CONF_USERNAME not in config: + if CONF_USERNAME not in entry_data: # Old versions of the config flow may not have the username by this point; # in that case, we reauth them by making them go through the user flow: return await self.async_step_user() - self._username = config[CONF_USERNAME] + self._username = entry_data[CONF_USERNAME] return await self.async_step_reauth_confirm() async def _async_get_email_2fa(self) -> None: diff --git a/homeassistant/components/sleepiq/config_flow.py b/homeassistant/components/sleepiq/config_flow.py index c78daa76fbc..16034b64e8b 100644 --- a/homeassistant/components/sleepiq/config_flow.py +++ b/homeassistant/components/sleepiq/config_flow.py @@ -80,12 +80,12 @@ class SleepIQFlowHandler(ConfigFlow, domain=DOMAIN): last_step=True, ) - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Perform reauth upon an API authentication error.""" self._reauth_entry = self.hass.config_entries.async_get_entry( self.context["entry_id"] ) - return await self.async_step_reauth_confirm(dict(data)) + return await self.async_step_reauth_confirm(dict(entry_data)) async def async_step_reauth_confirm( self, user_input: dict[str, Any] | None = None diff --git a/homeassistant/components/surepetcare/config_flow.py b/homeassistant/components/surepetcare/config_flow.py index b8b3d690a8b..7c4509259ad 100644 --- a/homeassistant/components/surepetcare/config_flow.py +++ b/homeassistant/components/surepetcare/config_flow.py @@ -87,9 +87,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): step_id="user", data_schema=USER_DATA_SCHEMA, errors=errors ) - async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" - self._username = config[CONF_USERNAME] + self._username = entry_data[CONF_USERNAME] return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( diff --git a/homeassistant/components/synology_dsm/config_flow.py b/homeassistant/components/synology_dsm/config_flow.py index bc35caf300e..89bbc4ae8c2 100644 --- a/homeassistant/components/synology_dsm/config_flow.py +++ b/homeassistant/components/synology_dsm/config_flow.py @@ -300,9 +300,9 @@ class SynologyDSMFlowHandler(ConfigFlow, domain=DOMAIN): user_input = {**self.discovered_conf, **user_input} return await self.async_validate_input_create_entry(user_input, step_id=step) - async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Perform reauth upon an API authentication error.""" - self.reauth_conf = data + self.reauth_conf = entry_data return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( diff --git a/homeassistant/components/tile/config_flow.py b/homeassistant/components/tile/config_flow.py index c47a46b3b10..3ba1dc411ae 100644 --- a/homeassistant/components/tile/config_flow.py +++ b/homeassistant/components/tile/config_flow.py @@ -75,9 +75,9 @@ class TileFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): """Import a config entry from configuration.yaml.""" return await self.async_step_user(import_config) - async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" - self._username = config[CONF_USERNAME] + self._username = entry_data[CONF_USERNAME] return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( diff --git a/homeassistant/components/watttime/config_flow.py b/homeassistant/components/watttime/config_flow.py index 4d6985ec616..a5d9c6925c8 100644 --- a/homeassistant/components/watttime/config_flow.py +++ b/homeassistant/components/watttime/config_flow.py @@ -190,9 +190,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): ) return await self.async_step_coordinates() - async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" - self._data = {**config} + self._data = {**entry_data} return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( diff --git a/homeassistant/components/xiaomi_miio/config_flow.py b/homeassistant/components/xiaomi_miio/config_flow.py index e5b5275757c..4e2ba24bc05 100644 --- a/homeassistant/components/xiaomi_miio/config_flow.py +++ b/homeassistant/components/xiaomi_miio/config_flow.py @@ -129,12 +129,12 @@ class XiaomiMiioFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): """Get the options flow.""" return OptionsFlowHandler(config_entry) - async def async_step_reauth(self, user_input: Mapping[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Perform reauth upon an authentication error or missing cloud credentials.""" - self.host = user_input[CONF_HOST] - self.token = user_input[CONF_TOKEN] - self.mac = user_input[CONF_MAC] - self.model = user_input.get(CONF_MODEL) + self.host = entry_data[CONF_HOST] + self.token = entry_data[CONF_TOKEN] + self.mac = entry_data[CONF_MAC] + self.model = entry_data.get(CONF_MODEL) return await self.async_step_reauth_confirm() async def async_step_reauth_confirm(