mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Use Mapping for async_step_reauth (t-z) (#72767)
* Adjust tailscale * Adjust tautulli * Adjust tile * Adjust tractive * Adjust trafikverket_ferry * Adjust trafikverket_train * Adjust unifiprotect * Adjust uptimerobot * Adjust verisure * Adjust vlc_telnet * Adjust wallbox * Adjust watttime * Adjust yale_smart_alarm
This commit is contained in:
parent
84779482b8
commit
9cea936c22
@ -1,6 +1,7 @@
|
|||||||
"""Config flow to configure the Tailscale integration."""
|
"""Config flow to configure the Tailscale integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from tailscale import Tailscale, TailscaleAuthenticationError, TailscaleError
|
from tailscale import Tailscale, TailscaleAuthenticationError, TailscaleError
|
||||||
@ -81,7 +82,7 @@ class TailscaleFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
errors=errors,
|
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 Tailscale."""
|
"""Handle initiation of re-authentication with Tailscale."""
|
||||||
self.reauth_entry = self.hass.config_entries.async_get_entry(
|
self.reauth_entry = self.hass.config_entries.async_get_entry(
|
||||||
self.context["entry_id"]
|
self.context["entry_id"]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Config flow for Tautulli."""
|
"""Config flow for Tautulli."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pytautulli import (
|
from pytautulli import (
|
||||||
@ -70,7 +71,7 @@ class TautulliConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
errors=errors or {},
|
errors=errors or {},
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(self, config: dict[str, Any]) -> FlowResult:
|
async def async_step_reauth(self, config: Mapping[str, Any]) -> FlowResult:
|
||||||
"""Handle a reauthorization flow request."""
|
"""Handle a reauthorization flow request."""
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Config flow to configure the Tile integration."""
|
"""Config flow to configure the Tile integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pytile import async_login
|
from pytile import async_login
|
||||||
@ -74,7 +75,7 @@ class TileFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
"""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_config)
|
||||||
|
|
||||||
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."""
|
"""Handle configuration by re-auth."""
|
||||||
self._username = config[CONF_USERNAME]
|
self._username = config[CONF_USERNAME]
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Config flow for tractive integration."""
|
"""Config flow for tractive integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
@ -69,7 +70,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
step_id="user", data_schema=USER_DATA_SCHEMA, errors=errors
|
step_id="user", data_schema=USER_DATA_SCHEMA, errors=errors
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(self, _: dict[str, Any]) -> FlowResult:
|
async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult:
|
||||||
"""Handle configuration by re-auth."""
|
"""Handle configuration by re-auth."""
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Adds config flow for Trafikverket Ferry integration."""
|
"""Adds config flow for Trafikverket Ferry integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pytrafikverket import TrafikverketFerry
|
from pytrafikverket import TrafikverketFerry
|
||||||
@ -59,9 +60,7 @@ class TVFerryConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
ferry_api = TrafikverketFerry(web_session, api_key)
|
ferry_api = TrafikverketFerry(web_session, api_key)
|
||||||
await ferry_api.async_get_next_ferry_stop(ferry_from, ferry_to)
|
await ferry_api.async_get_next_ferry_stop(ferry_from, ferry_to)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult:
|
||||||
self, user_input: dict[str, Any] | None = None
|
|
||||||
) -> FlowResult:
|
|
||||||
"""Handle re-authentication with Trafikverket."""
|
"""Handle re-authentication with Trafikverket."""
|
||||||
|
|
||||||
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Adds config flow for Trafikverket Train integration."""
|
"""Adds config flow for Trafikverket Train integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pytrafikverket import TrafikverketTrain
|
from pytrafikverket import TrafikverketTrain
|
||||||
@ -54,9 +55,7 @@ class TVTrainConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
await train_api.async_get_train_station(train_from)
|
await train_api.async_get_train_station(train_from)
|
||||||
await train_api.async_get_train_station(train_to)
|
await train_api.async_get_train_station(train_to)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult:
|
||||||
self, user_input: dict[str, Any] | None = None
|
|
||||||
) -> FlowResult:
|
|
||||||
"""Handle re-authentication with Trafikverket."""
|
"""Handle re-authentication with Trafikverket."""
|
||||||
|
|
||||||
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Config Flow to configure UniFi Protect Integration."""
|
"""Config Flow to configure UniFi Protect Integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
@ -236,7 +237,7 @@ class ProtectFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
return nvr_data, errors
|
return nvr_data, errors
|
||||||
|
|
||||||
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."""
|
"""Perform reauth upon an API authentication error."""
|
||||||
|
|
||||||
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Config flow for UptimeRobot integration."""
|
"""Config flow for UptimeRobot integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pyuptimerobot import (
|
from pyuptimerobot import (
|
||||||
@ -84,9 +85,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
step_id="user", data_schema=STEP_USER_DATA_SCHEMA, errors=errors
|
step_id="user", data_schema=STEP_USER_DATA_SCHEMA, errors=errors
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult:
|
||||||
self, user_input: dict[str, Any] | None = None
|
|
||||||
) -> FlowResult:
|
|
||||||
"""Return the reauth confirm step."""
|
"""Return the reauth confirm step."""
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Config flow for Verisure integration."""
|
"""Config flow for Verisure integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from verisure import (
|
from verisure import (
|
||||||
@ -108,7 +109,7 @@ class VerisureConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
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 Verisure."""
|
"""Handle initiation of re-authentication with Verisure."""
|
||||||
self.entry = cast(
|
self.entry = cast(
|
||||||
ConfigEntry,
|
ConfigEntry,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Config flow for VLC media player Telnet integration."""
|
"""Config flow for VLC media player Telnet integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
@ -104,7 +105,7 @@ class VLCTelnetConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
step_id="user", data_schema=user_form_schema(user_input), errors=errors
|
step_id="user", data_schema=user_form_schema(user_input), 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 reauth flow."""
|
"""Handle reauth flow."""
|
||||||
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
assert self.entry
|
assert self.entry
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Config flow for Wallbox integration."""
|
"""Config flow for Wallbox integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
@ -47,9 +48,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=COMPONENT_DOMAIN):
|
|||||||
"""Start the Wallbox config flow."""
|
"""Start the Wallbox config flow."""
|
||||||
self._reauth_entry: config_entries.ConfigEntry | None = None
|
self._reauth_entry: config_entries.ConfigEntry | None = None
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult:
|
||||||
self, user_input: dict[str, Any] | None = None
|
|
||||||
) -> FlowResult:
|
|
||||||
"""Perform reauth upon an API authentication error."""
|
"""Perform reauth upon an API authentication error."""
|
||||||
self._reauth_entry = self.hass.config_entries.async_get_entry(
|
self._reauth_entry = self.hass.config_entries.async_get_entry(
|
||||||
self.context["entry_id"]
|
self.context["entry_id"]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Config flow for WattTime integration."""
|
"""Config flow for WattTime integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
from aiowatttime import Client
|
from aiowatttime import Client
|
||||||
@ -189,7 +190,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
return await self.async_step_coordinates()
|
return await self.async_step_coordinates()
|
||||||
|
|
||||||
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."""
|
"""Handle configuration by re-auth."""
|
||||||
self._data = {**config}
|
self._data = {**config}
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Adds config flow for Yale Smart Alarm integration."""
|
"""Adds config flow for Yale Smart Alarm integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
@ -53,9 +54,7 @@ class YaleConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return YaleOptionsFlowHandler(config_entry)
|
return YaleOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult:
|
||||||
self, user_input: dict[str, Any] | None = None
|
|
||||||
) -> FlowResult:
|
|
||||||
"""Handle initiation of re-authentication with Yale."""
|
"""Handle initiation of re-authentication with Yale."""
|
||||||
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user