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
This commit is contained in:
J. Nick Koston 2024-01-22 11:33:49 -10:00 committed by GitHub
parent 4378a171b2
commit 07926660bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -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,

View File

@ -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"