Use new reauth helpers in weatherflow_cloud (#128821)

This commit is contained in:
epenet 2024-10-20 09:43:55 +02:00 committed by GitHub
parent d9fd2c28b0
commit b588bd6e4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,15 +49,11 @@ class WeatherFlowCloudConfigFlow(ConfigFlow, domain=DOMAIN):
errors = await _validate_api_token(api_token) errors = await _validate_api_token(api_token)
if not errors: if not errors:
# Update the existing entry and abort # Update the existing entry and abort
if existing_entry := self.hass.config_entries.async_get_entry( return self.async_update_reload_and_abort(
self.context["entry_id"] self._get_reauth_entry(),
): data={CONF_API_TOKEN: api_token},
return self.async_update_reload_and_abort( reload_even_if_entry_is_unchanged=False,
existing_entry, )
data={CONF_API_TOKEN: api_token},
reason="reauth_successful",
reload_even_if_entry_is_unchanged=False,
)
return self.async_show_form( return self.async_show_form(
step_id="reauth_confirm", step_id="reauth_confirm",