Use async_update_reload_and_abort in Trafikverket Weather reauth flow (#127341)
parent
19535b48ab
commit
df8269e772
|
@ -108,15 +108,9 @@ class TVWeatherConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||||
except Exception: # noqa: BLE001
|
except Exception: # noqa: BLE001
|
||||||
errors["base"] = "cannot_connect"
|
errors["base"] = "cannot_connect"
|
||||||
else:
|
else:
|
||||||
self.hass.config_entries.async_update_entry(
|
return self.async_update_reload_and_abort(
|
||||||
self.entry,
|
self.entry, data={**self.entry.data, CONF_API_KEY: api_key}
|
||||||
data={
|
|
||||||
**self.entry.data,
|
|
||||||
CONF_API_KEY: api_key,
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
await self.hass.config_entries.async_reload(self.entry.entry_id)
|
|
||||||
return self.async_abort(reason="reauth_successful")
|
|
||||||
|
|
||||||
return self.async_show_form(
|
return self.async_show_form(
|
||||||
step_id="reauth_confirm",
|
step_id="reauth_confirm",
|
||||||
|
|
Loading…
Reference in New Issue