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
This commit is contained in:
epenet 2024-10-03 14:39:17 +02:00 committed by GitHub
parent a218f4adc3
commit 045d96cdd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -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()

View File

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