Use reauth helpers in huawei_lte (#128630)

This commit is contained in:
epenet 2024-10-18 08:46:21 +02:00 committed by GitHub
parent 1d5821abca
commit 409f1bb644
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -320,8 +320,7 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Dialog that informs the user that reauth is required."""
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
assert entry
entry = self._get_reauth_entry()
if not user_input:
return await self._async_show_reauth_form(
user_input={
@ -340,9 +339,7 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
user_input=user_input, errors=errors
)
self.hass.config_entries.async_update_entry(entry, data=new_data)
await self.hass.config_entries.async_reload(entry.entry_id)
return self.async_abort(reason="reauth_successful")
return self.async_update_reload_and_abort(entry, data=new_data)
class OptionsFlowHandler(OptionsFlow):