mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
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:
parent
a218f4adc3
commit
045d96cdd1
@ -78,7 +78,7 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Store validated credentials."""
|
"""Store validated credentials."""
|
||||||
|
|
||||||
if self.source == SOURCE_REAUTH:
|
if self.source == SOURCE_REAUTH:
|
||||||
self.hass.config_entries.async_update_entry(
|
return self.async_update_reload_and_abort(
|
||||||
self.reauth_entry,
|
self.reauth_entry,
|
||||||
title=info[CONF_EMAIL],
|
title=info[CONF_EMAIL],
|
||||||
data={
|
data={
|
||||||
@ -86,8 +86,6 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
CONF_PASSWORD: info[CONF_PASSWORD],
|
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])
|
await self.async_set_unique_id(info[CONF_UNIQUE_ID])
|
||||||
self._abort_if_unique_id_configured()
|
self._abort_if_unique_id_configured()
|
||||||
|
@ -153,6 +153,7 @@ async def test_async_step_reauth_success(hass: HomeAssistant, user: User) -> Non
|
|||||||
result["flow_id"],
|
result["flow_id"],
|
||||||
{CONF_EMAIL: "aseko@example.com", CONF_PASSWORD: "passw0rd"},
|
{CONF_EMAIL: "aseko@example.com", CONF_PASSWORD: "passw0rd"},
|
||||||
)
|
)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
assert result["type"] is FlowResultType.ABORT
|
assert result["type"] is FlowResultType.ABORT
|
||||||
assert result["reason"] == "reauth_successful"
|
assert result["reason"] == "reauth_successful"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user