Improve ergonomics of FlowManager.async_show_progress (#107668)
* Improve ergonomics of FlowManager.async_show_progress * Don't include progress coroutine in web response * Unconditionally reset progress task when show_progress finished * Fix race * Tweak, add tests * Address review comments * Improve error handling * Allow progress jobs to return anything * Add comment * Remove unneeded check * Change API according to discussion * Adjust typing
This commit is contained in:
parent
00b40c964a
commit
24cd6a8a52
4 changed files with 221 additions and 28 deletions
|
@ -121,10 +121,11 @@ async def test_flow_with_activation_failure(
|
|||
)
|
||||
assert result["step_id"] == "device"
|
||||
assert result["type"] == FlowResultType.SHOW_PROGRESS
|
||||
await hass.async_block_till_done()
|
||||
|
||||
result = await hass.config_entries.flow.async_configure(result["flow_id"])
|
||||
assert result["type"] == FlowResultType.SHOW_PROGRESS_DONE
|
||||
assert result["step_id"] == "could_not_register"
|
||||
assert result["type"] == FlowResultType.ABORT
|
||||
assert result["reason"] == "could_not_register"
|
||||
|
||||
|
||||
async def test_flow_with_remove_while_activating(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue