Use _get_reauth_entry in bring config flow (#127325)

This commit is contained in:
epenet 2024-10-02 19:36:32 +02:00 committed by GitHub
parent c306ebed49
commit 829af75416
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,7 +50,7 @@ class BringConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Bring!."""
VERSION = 1
reauth_entry: BringConfigEntry | None = None
reauth_entry: BringConfigEntry
info: BringAuthResponse
async def async_step_user(
@ -74,9 +74,7 @@ class BringConfigFlow(ConfigFlow, domain=DOMAIN):
self, entry_data: Mapping[str, Any]
) -> ConfigFlowResult:
"""Perform reauth upon an API authentication error."""
self.reauth_entry = self.hass.config_entries.async_get_entry(
self.context["entry_id"]
)
self.reauth_entry = self._get_reauth_entry()
return await self.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."""
errors: dict[str, str] = {}
assert self.reauth_entry
if user_input is not None:
if not (errors := await self.validate_input(user_input)):
return self.async_update_reload_and_abort(