mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Standardize reauth step variable name in config flows (#124760)
This commit is contained in:
parent
d4ae592a85
commit
51a5a78eb5
@ -112,10 +112,12 @@ class DevoloHomeNetworkConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
description_placeholders={"host_name": title},
|
description_placeholders={"host_name": title},
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(self, data: Mapping[str, Any]) -> ConfigFlowResult:
|
async def async_step_reauth(
|
||||||
|
self, entry_data: Mapping[str, Any]
|
||||||
|
) -> ConfigFlowResult:
|
||||||
"""Handle reauthentication."""
|
"""Handle reauthentication."""
|
||||||
if entry := self.hass.config_entries.async_get_entry(self.context["entry_id"]):
|
if entry := self.hass.config_entries.async_get_entry(self.context["entry_id"]):
|
||||||
self.context[CONF_HOST] = data[CONF_IP_ADDRESS]
|
self.context[CONF_HOST] = entry_data[CONF_IP_ADDRESS]
|
||||||
self.context["title_placeholders"][PRODUCT] = (
|
self.context["title_placeholders"][PRODUCT] = (
|
||||||
entry.runtime_data.device.product
|
entry.runtime_data.device.product
|
||||||
)
|
)
|
||||||
|
@ -319,7 +319,7 @@ class EzvizConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, user_input: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a flow for reauthentication with password."""
|
"""Handle a flow for reauthentication with password."""
|
||||||
|
|
||||||
|
@ -172,9 +172,11 @@ class FrontierSiliconConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
step_id="confirm", description_placeholders={"name": self._name}
|
step_id="confirm", description_placeholders={"name": self._name}
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(self, config: Mapping[str, Any]) -> ConfigFlowResult:
|
async def async_step_reauth(
|
||||||
|
self, entry_data: Mapping[str, Any]
|
||||||
|
) -> ConfigFlowResult:
|
||||||
"""Perform reauth upon an API authentication error."""
|
"""Perform reauth upon an API authentication error."""
|
||||||
self._webfsapi_url = config[CONF_WEBFSAPI_URL]
|
self._webfsapi_url = entry_data[CONF_WEBFSAPI_URL]
|
||||||
|
|
||||||
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"]
|
||||||
|
@ -90,7 +90,7 @@ class HydrawiseConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, user_input: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Perform reauth after updating config to username/password."""
|
"""Perform reauth after updating config to username/password."""
|
||||||
self.reauth_entry = self.hass.config_entries.async_get_entry(
|
self.reauth_entry = self.hass.config_entries.async_get_entry(
|
||||||
|
@ -77,7 +77,7 @@ class JustNimbusConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, user_input: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""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(
|
||||||
|
@ -74,7 +74,7 @@ class JvcProjectorConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, user_input: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Perform reauth on password authentication error."""
|
"""Perform reauth on password authentication error."""
|
||||||
self._reauth_entry = self.hass.config_entries.async_get_entry(
|
self._reauth_entry = self.hass.config_entries.async_get_entry(
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
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
|
||||||
@ -41,7 +42,9 @@ class KitchenSinkConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
return self.async_create_entry(title="Kitchen Sink", data=import_data)
|
return self.async_create_entry(title="Kitchen Sink", data=import_data)
|
||||||
|
|
||||||
async def async_step_reauth(self, data):
|
async def async_step_reauth(
|
||||||
|
self, entry_data: Mapping[str, Any]
|
||||||
|
) -> ConfigFlowResult:
|
||||||
"""Reauth step."""
|
"""Reauth step."""
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class LidarrConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self.entry: LidarrConfigEntry | None = None
|
self.entry: LidarrConfigEntry | None = None
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, user_input: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle configuration by re-auth."""
|
"""Handle configuration by re-auth."""
|
||||||
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"])
|
||||||
|
@ -83,7 +83,9 @@ class MikrotikFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
errors=errors,
|
errors=errors,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(self, data: Mapping[str, Any]) -> ConfigFlowResult:
|
async def async_step_reauth(
|
||||||
|
self, entry_data: Mapping[str, Any]
|
||||||
|
) -> ConfigFlowResult:
|
||||||
"""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"]
|
||||||
|
@ -215,13 +215,15 @@ class OctoPrintConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
return await self.async_step_user()
|
return await self.async_step_user()
|
||||||
|
|
||||||
async def async_step_reauth(self, config: Mapping[str, Any]) -> ConfigFlowResult:
|
async def async_step_reauth(
|
||||||
|
self, entry_data: Mapping[str, Any]
|
||||||
|
) -> ConfigFlowResult:
|
||||||
"""Handle reauthorization request from Octoprint."""
|
"""Handle reauthorization request from Octoprint."""
|
||||||
self._reauth_data = dict(config)
|
self._reauth_data = dict(entry_data)
|
||||||
|
|
||||||
self.context.update(
|
self.context.update(
|
||||||
{
|
{
|
||||||
"title_placeholders": {CONF_HOST: config[CONF_HOST]},
|
"title_placeholders": {CONF_HOST: entry_data[CONF_HOST]},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -69,9 +69,9 @@ class OSOEnergyFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, user_input: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Re Authenticate a user."""
|
"""Re Authenticate a user."""
|
||||||
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"])
|
||||||
data = {CONF_API_KEY: user_input[CONF_API_KEY]}
|
data = {CONF_API_KEY: entry_data[CONF_API_KEY]}
|
||||||
return await self.async_step_user(data)
|
return await self.async_step_user(data)
|
||||||
|
@ -26,7 +26,9 @@ class RadarrConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
VERSION = 1
|
VERSION = 1
|
||||||
entry: RadarrConfigEntry | None = None
|
entry: RadarrConfigEntry | None = None
|
||||||
|
|
||||||
async def async_step_reauth(self, _: Mapping[str, Any]) -> ConfigFlowResult:
|
async def async_step_reauth(
|
||||||
|
self, entry_data: Mapping[str, Any]
|
||||||
|
) -> ConfigFlowResult:
|
||||||
"""Handle configuration by re-auth."""
|
"""Handle configuration by re-auth."""
|
||||||
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"])
|
||||||
|
|
||||||
|
@ -69,7 +69,9 @@ class SimpliSafeFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Define the config flow to handle options."""
|
"""Define the config flow to handle options."""
|
||||||
return SimpliSafeOptionsFlowHandler(config_entry)
|
return SimpliSafeOptionsFlowHandler(config_entry)
|
||||||
|
|
||||||
async def async_step_reauth(self, config: Mapping[str, Any]) -> ConfigFlowResult:
|
async def async_step_reauth(
|
||||||
|
self, entry_data: Mapping[str, Any]
|
||||||
|
) -> ConfigFlowResult:
|
||||||
"""Handle configuration by re-auth."""
|
"""Handle configuration by re-auth."""
|
||||||
self._reauth = True
|
self._reauth = True
|
||||||
return await self.async_step_user()
|
return await self.async_step_user()
|
||||||
|
@ -144,7 +144,9 @@ class TailwindFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
errors=errors,
|
errors=errors,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(self, _: Mapping[str, Any]) -> ConfigFlowResult:
|
async def async_step_reauth(
|
||||||
|
self, entry_data: Mapping[str, Any]
|
||||||
|
) -> ConfigFlowResult:
|
||||||
"""Handle initiation of re-authentication with a Tailwind device."""
|
"""Handle initiation of re-authentication with a Tailwind device."""
|
||||||
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"]
|
||||||
|
@ -66,7 +66,7 @@ class TessieConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, user_input: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle re-auth."""
|
"""Handle re-auth."""
|
||||||
self._reauth_entry = self.hass.config_entries.async_get_entry(
|
self._reauth_entry = self.hass.config_entries.async_get_entry(
|
||||||
|
@ -89,7 +89,7 @@ class TTNFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
return self.async_show_form(step_id="user", data_schema=schema, errors=errors)
|
return self.async_show_form(step_id="user", data_schema=schema, errors=errors)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, user_input: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a flow initialized by a reauth event."""
|
"""Handle a flow initialized by a reauth event."""
|
||||||
|
|
||||||
|
@ -146,7 +146,9 @@ class TuyaConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
data=entry_data,
|
data=entry_data,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(self, _: Mapping[str, Any]) -> ConfigFlowResult:
|
async def async_step_reauth(
|
||||||
|
self, entry_data: Mapping[str, Any]
|
||||||
|
) -> ConfigFlowResult:
|
||||||
"""Handle initiation of re-authentication with Tuya."""
|
"""Handle initiation of re-authentication with Tuya."""
|
||||||
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"]
|
||||||
|
@ -107,7 +107,7 @@ class VolvoOnCallConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, user_input: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user