From df8269e7721b01f464d1553a38876e47134e6826 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Thu, 3 Oct 2024 12:31:21 +0200 Subject: [PATCH] Use async_update_reload_and_abort in Trafikverket Weather reauth flow (#127341) --- .../trafikverket_weatherstation/config_flow.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/trafikverket_weatherstation/config_flow.py b/homeassistant/components/trafikverket_weatherstation/config_flow.py index 7498c0de554..9d1bfd7592a 100644 --- a/homeassistant/components/trafikverket_weatherstation/config_flow.py +++ b/homeassistant/components/trafikverket_weatherstation/config_flow.py @@ -108,15 +108,9 @@ class TVWeatherConfigFlow(ConfigFlow, domain=DOMAIN): except Exception: # noqa: BLE001 errors["base"] = "cannot_connect" else: - self.hass.config_entries.async_update_entry( - self.entry, - data={ - **self.entry.data, - CONF_API_KEY: api_key, - }, + return self.async_update_reload_and_abort( + self.entry, 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( step_id="reauth_confirm",