diff --git a/homeassistant/components/powerwall/config_flow.py b/homeassistant/components/powerwall/config_flow.py index 836aa46e2a4..b541c1b4bf7 100644 --- a/homeassistant/components/powerwall/config_flow.py +++ b/homeassistant/components/powerwall/config_flow.py @@ -1,6 +1,7 @@ """Config flow for Tesla Powerwall integration.""" from __future__ import annotations +from collections.abc import Mapping import logging from typing import Any @@ -205,7 +206,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): errors=errors, ) - async def async_step_reauth(self, data: dict[str, str]) -> FlowResult: + async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" self.reauth_entry = self.hass.config_entries.async_get_entry( self.context["entry_id"] diff --git a/homeassistant/components/pvoutput/config_flow.py b/homeassistant/components/pvoutput/config_flow.py index 4349a79593e..25cc68acc24 100644 --- a/homeassistant/components/pvoutput/config_flow.py +++ b/homeassistant/components/pvoutput/config_flow.py @@ -1,6 +1,7 @@ """Config flow to configure the PVOutput integration.""" from __future__ import annotations +from collections.abc import Mapping from typing import Any from pvo import PVOutput, PVOutputAuthenticationError, PVOutputError @@ -83,7 +84,7 @@ class PVOutputFlowHandler(ConfigFlow, domain=DOMAIN): errors=errors, ) - async def async_step_reauth(self, data: dict[str, Any]) -> FlowResult: + async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: """Handle initiation of re-authentication with PVOutput.""" self.reauth_entry = self.hass.config_entries.async_get_entry( self.context["entry_id"] diff --git a/homeassistant/components/renault/config_flow.py b/homeassistant/components/renault/config_flow.py index 47832cdbe93..539ba7549b3 100644 --- a/homeassistant/components/renault/config_flow.py +++ b/homeassistant/components/renault/config_flow.py @@ -1,6 +1,7 @@ """Config flow to configure Renault component.""" from __future__ import annotations +from collections.abc import Mapping from typing import TYPE_CHECKING, Any from renault_api.const import AVAILABLE_LOCALES @@ -21,7 +22,7 @@ class RenaultFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): def __init__(self) -> None: """Initialize the Renault config flow.""" - self._original_data: dict[str, Any] | None = None + self._original_data: Mapping[str, Any] | None = None self.renault_config: dict[str, Any] = {} self.renault_hub: RenaultHub | None = None @@ -92,9 +93,9 @@ class RenaultFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): ), ) - async def async_step_reauth(self, user_input: dict[str, Any]) -> FlowResult: + async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: """Perform reauth upon an API authentication error.""" - self._original_data = user_input.copy() + self._original_data = 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 405474f5875..2d6444fede9 100644 --- a/homeassistant/components/ridwell/config_flow.py +++ b/homeassistant/components/ridwell/config_flow.py @@ -1,6 +1,7 @@ """Config flow for Ridwell integration.""" from __future__ import annotations +from collections.abc import Mapping from typing import TYPE_CHECKING, Any from aioridwell import async_get_client @@ -80,7 +81,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): data={CONF_USERNAME: self._username, CONF_PASSWORD: self._password}, ) - async def async_step_reauth(self, config: dict[str, Any]) -> FlowResult: + async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" self._username = config[CONF_USERNAME] return await self.async_step_reauth_confirm() diff --git a/homeassistant/components/samsungtv/config_flow.py b/homeassistant/components/samsungtv/config_flow.py index bfa2482f617..130b1d28d5f 100644 --- a/homeassistant/components/samsungtv/config_flow.py +++ b/homeassistant/components/samsungtv/config_flow.py @@ -1,9 +1,9 @@ """Config flow for Samsung TV.""" from __future__ import annotations +from collections.abc import Mapping from functools import partial import socket -from types import MappingProxyType from typing import Any from urllib.parse import urlparse @@ -525,7 +525,7 @@ class SamsungTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): ) async def async_step_reauth( - self, data: MappingProxyType[str, Any] + self, data: Mapping[str, Any] ) -> data_entry_flow.FlowResult: """Handle configuration by re-auth.""" self._reauth_entry = self.hass.config_entries.async_get_entry( diff --git a/homeassistant/components/sensibo/config_flow.py b/homeassistant/components/sensibo/config_flow.py index a3254a01839..a3214bdad56 100644 --- a/homeassistant/components/sensibo/config_flow.py +++ b/homeassistant/components/sensibo/config_flow.py @@ -1,6 +1,7 @@ """Adds config flow for Sensibo integration.""" from __future__ import annotations +from collections.abc import Mapping from typing import Any from pysensibo.exceptions import AuthenticationError @@ -28,9 +29,7 @@ class SensiboConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): entry: config_entries.ConfigEntry | None - async def async_step_reauth( - self, user_input: dict[str, Any] | None = None - ) -> FlowResult: + async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: """Handle re-authentication with Sensibo.""" self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"]) diff --git a/homeassistant/components/simplisafe/config_flow.py b/homeassistant/components/simplisafe/config_flow.py index 14afc743b23..3fcab1f3966 100644 --- a/homeassistant/components/simplisafe/config_flow.py +++ b/homeassistant/components/simplisafe/config_flow.py @@ -2,6 +2,7 @@ from __future__ import annotations import asyncio +from collections.abc import Mapping from typing import Any import async_timeout @@ -97,7 +98,7 @@ 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: dict[str, Any]) -> FlowResult: + async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" self._reauth = True diff --git a/homeassistant/components/sleepiq/config_flow.py b/homeassistant/components/sleepiq/config_flow.py index 49f14eff0b9..c78daa76fbc 100644 --- a/homeassistant/components/sleepiq/config_flow.py +++ b/homeassistant/components/sleepiq/config_flow.py @@ -1,6 +1,7 @@ """Config flow to configure SleepIQ component.""" from __future__ import annotations +from collections.abc import Mapping import logging from typing import Any @@ -79,12 +80,12 @@ class SleepIQFlowHandler(ConfigFlow, domain=DOMAIN): last_step=True, ) - async def async_step_reauth(self, user_input: dict[str, Any]) -> FlowResult: + async def async_step_reauth(self, 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(user_input) + return await self.async_step_reauth_confirm(dict(data)) async def async_step_reauth_confirm( self, user_input: dict[str, Any] | None = None diff --git a/homeassistant/components/steam_online/config_flow.py b/homeassistant/components/steam_online/config_flow.py index 338b0a80fb6..94b3e8d809c 100644 --- a/homeassistant/components/steam_online/config_flow.py +++ b/homeassistant/components/steam_online/config_flow.py @@ -1,6 +1,7 @@ """Config flow for Steam integration.""" from __future__ import annotations +from collections.abc import Mapping from typing import Any import steam @@ -125,7 +126,7 @@ class SteamFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): import_config[CONF_ACCOUNT] = import_config[CONF_ACCOUNTS][0] return await self.async_step_user(import_config) - async def async_step_reauth(self, user_input: dict[str, str]) -> FlowResult: + async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: """Handle a reauthorization flow request.""" self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"]) diff --git a/homeassistant/components/surepetcare/config_flow.py b/homeassistant/components/surepetcare/config_flow.py index 30f20257e8c..b8b3d690a8b 100644 --- a/homeassistant/components/surepetcare/config_flow.py +++ b/homeassistant/components/surepetcare/config_flow.py @@ -1,6 +1,7 @@ """Config flow for Sure Petcare integration.""" from __future__ import annotations +from collections.abc import Mapping import logging from typing import Any @@ -86,7 +87,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): step_id="user", data_schema=USER_DATA_SCHEMA, errors=errors ) - async def async_step_reauth(self, config: dict[str, Any]) -> FlowResult: + async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult: """Handle configuration by re-auth.""" self._username = config[CONF_USERNAME] return await self.async_step_reauth_confirm() diff --git a/homeassistant/components/synology_dsm/config_flow.py b/homeassistant/components/synology_dsm/config_flow.py index 256ad5eef8e..bc35caf300e 100644 --- a/homeassistant/components/synology_dsm/config_flow.py +++ b/homeassistant/components/synology_dsm/config_flow.py @@ -1,6 +1,7 @@ """Config flow to configure the Synology DSM integration.""" from __future__ import annotations +from collections.abc import Mapping from ipaddress import ip_address import logging from typing import Any @@ -120,7 +121,7 @@ class SynologyDSMFlowHandler(ConfigFlow, domain=DOMAIN): """Initialize the synology_dsm config flow.""" self.saved_user_input: dict[str, Any] = {} self.discovered_conf: dict[str, Any] = {} - self.reauth_conf: dict[str, Any] = {} + self.reauth_conf: Mapping[str, Any] = {} self.reauth_reason: str | None = None def _show_form( @@ -299,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: dict[str, Any]) -> FlowResult: + async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult: """Perform reauth upon an API authentication error.""" - self.reauth_conf = data.copy() + self.reauth_conf = data return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( diff --git a/homeassistant/components/system_bridge/config_flow.py b/homeassistant/components/system_bridge/config_flow.py index 0c1241fcf2c..9d89cf83288 100644 --- a/homeassistant/components/system_bridge/config_flow.py +++ b/homeassistant/components/system_bridge/config_flow.py @@ -2,6 +2,7 @@ from __future__ import annotations import asyncio +from collections.abc import Mapping import logging from typing import Any @@ -202,7 +203,7 @@ class ConfigFlow( return await self.async_step_authenticate() - async def async_step_reauth(self, entry_data: dict[str, Any]) -> FlowResult: + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Perform reauth upon an API authentication error.""" self._name = entry_data[CONF_HOST] self._input = {