mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00
Use _get_reauth_entry in bring config flow (#127325)
This commit is contained in:
parent
c306ebed49
commit
829af75416
@ -50,7 +50,7 @@ class BringConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Handle a config flow for Bring!."""
|
"""Handle a config flow for Bring!."""
|
||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
reauth_entry: BringConfigEntry | None = None
|
reauth_entry: BringConfigEntry
|
||||||
info: BringAuthResponse
|
info: BringAuthResponse
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
@ -74,9 +74,7 @@ class BringConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self, entry_data: 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._get_reauth_entry()
|
||||||
self.context["entry_id"]
|
|
||||||
)
|
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
|
||||||
async def async_step_reauth_confirm(
|
async def async_step_reauth_confirm(
|
||||||
@ -85,8 +83,6 @@ class BringConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Dialog that informs the user that reauth is required."""
|
"""Dialog that informs the user that reauth is required."""
|
||||||
errors: dict[str, str] = {}
|
errors: dict[str, str] = {}
|
||||||
|
|
||||||
assert self.reauth_entry
|
|
||||||
|
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
if not (errors := await self.validate_input(user_input)):
|
if not (errors := await self.validate_input(user_input)):
|
||||||
return self.async_update_reload_and_abort(
|
return self.async_update_reload_and_abort(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user