Use new reauth helpers in weatherflow_cloud (#128821)
This commit is contained in:
parent
d9fd2c28b0
commit
b588bd6e4f
1 changed files with 5 additions and 9 deletions
|
@ -49,15 +49,11 @@ class WeatherFlowCloudConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
errors = await _validate_api_token(api_token)
|
||||
if not errors:
|
||||
# Update the existing entry and abort
|
||||
if existing_entry := self.hass.config_entries.async_get_entry(
|
||||
self.context["entry_id"]
|
||||
):
|
||||
return self.async_update_reload_and_abort(
|
||||
existing_entry,
|
||||
data={CONF_API_TOKEN: api_token},
|
||||
reason="reauth_successful",
|
||||
reload_even_if_entry_is_unchanged=False,
|
||||
)
|
||||
return self.async_update_reload_and_abort(
|
||||
self._get_reauth_entry(),
|
||||
data={CONF_API_TOKEN: api_token},
|
||||
reload_even_if_entry_is_unchanged=False,
|
||||
)
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="reauth_confirm",
|
||||
|
|
Loading…
Add table
Reference in a new issue