From 045d96cdd122723af134c85b13ff59c7db8d5421 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:39:17 +0200 Subject: [PATCH] Use async_update_reload_and_abort in aseko_pool_live config flow (#127433) * Use async_update_reload_and_abort in aseko_pool_live config flow * block_till_done --- homeassistant/components/aseko_pool_live/config_flow.py | 4 +--- tests/components/aseko_pool_live/test_config_flow.py | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/aseko_pool_live/config_flow.py b/homeassistant/components/aseko_pool_live/config_flow.py index f4e61c6a69c..eacb7f2a42d 100644 --- a/homeassistant/components/aseko_pool_live/config_flow.py +++ b/homeassistant/components/aseko_pool_live/config_flow.py @@ -78,7 +78,7 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN): """Store validated credentials.""" if self.source == SOURCE_REAUTH: - self.hass.config_entries.async_update_entry( + return self.async_update_reload_and_abort( self.reauth_entry, title=info[CONF_EMAIL], data={ @@ -86,8 +86,6 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN): CONF_PASSWORD: info[CONF_PASSWORD], }, ) - await self.hass.config_entries.async_reload(self.reauth_entry.entry_id) - return self.async_abort(reason="reauth_successful") await self.async_set_unique_id(info[CONF_UNIQUE_ID]) self._abort_if_unique_id_configured() diff --git a/tests/components/aseko_pool_live/test_config_flow.py b/tests/components/aseko_pool_live/test_config_flow.py index de1bf0912f8..eb40decf213 100644 --- a/tests/components/aseko_pool_live/test_config_flow.py +++ b/tests/components/aseko_pool_live/test_config_flow.py @@ -153,6 +153,7 @@ async def test_async_step_reauth_success(hass: HomeAssistant, user: User) -> Non result["flow_id"], {CONF_EMAIL: "aseko@example.com", CONF_PASSWORD: "passw0rd"}, ) + await hass.async_block_till_done() assert result["type"] is FlowResultType.ABORT assert result["reason"] == "reauth_successful"