From 07926660bc00c0e7e37440edbdb4d8fc9376a95a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 22 Jan 2024 11:33:49 -1000 Subject: [PATCH] Use new config entry update/abort helper in isy994 (#108678) Use new config entry update/abort helper in isy994 uses the new helper from https://github.com/home-assistant/core/pull/108034 --- homeassistant/components/isy994/config_flow.py | 7 +++---- tests/components/isy994/test_config_flow.py | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/isy994/config_flow.py b/homeassistant/components/isy994/config_flow.py index 9f16b4a0d0c..2cdfd1df16d 100644 --- a/homeassistant/components/isy994/config_flow.py +++ b/homeassistant/components/isy994/config_flow.py @@ -276,10 +276,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): except InvalidAuth: errors[CONF_PASSWORD] = "invalid_auth" else: - cfg_entries = self.hass.config_entries - cfg_entries.async_update_entry(existing_entry, data=new_data) - await cfg_entries.async_reload(existing_entry.entry_id) - return self.async_abort(reason="reauth_successful") + return self.async_update_reload_and_abort( + self._existing_entry, data=new_data + ) self.context["title_placeholders"] = { CONF_NAME: existing_entry.title, diff --git a/tests/components/isy994/test_config_flow.py b/tests/components/isy994/test_config_flow.py index fe344332f38..4a5bfb007f0 100644 --- a/tests/components/isy994/test_config_flow.py +++ b/tests/components/isy994/test_config_flow.py @@ -676,6 +676,7 @@ async def test_reauth(hass: HomeAssistant) -> None: CONF_PASSWORD: "test-password", }, ) + await hass.async_block_till_done() assert mock_setup_entry.called assert result4["type"] == "abort"