mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add workaround for data entry flow show progress (#116704)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
parent
ac12d2a463
commit
1e72e9e0b2
@ -352,6 +352,18 @@ class FlowManager(abc.ABC, Generic[_FlowResultT, _HandlerT]):
|
|||||||
) -> _FlowResultT:
|
) -> _FlowResultT:
|
||||||
"""Continue a data entry flow."""
|
"""Continue a data entry flow."""
|
||||||
result: _FlowResultT | None = None
|
result: _FlowResultT | None = None
|
||||||
|
|
||||||
|
# Workaround for flow handlers which have not been upgraded to pass a show
|
||||||
|
# progress task, needed because of the change to eager tasks in HA Core 2024.5,
|
||||||
|
# can be removed in HA Core 2024.8.
|
||||||
|
flow = self._progress.get(flow_id)
|
||||||
|
if flow and flow.deprecated_show_progress:
|
||||||
|
if (cur_step := flow.cur_step) and cur_step[
|
||||||
|
"type"
|
||||||
|
] == FlowResultType.SHOW_PROGRESS:
|
||||||
|
# Allow the progress task to finish before we call the flow handler
|
||||||
|
await asyncio.sleep(0)
|
||||||
|
|
||||||
while not result or result["type"] == FlowResultType.SHOW_PROGRESS_DONE:
|
while not result or result["type"] == FlowResultType.SHOW_PROGRESS_DONE:
|
||||||
result = await self._async_configure(flow_id, user_input)
|
result = await self._async_configure(flow_id, user_input)
|
||||||
flow = self._progress.get(flow_id)
|
flow = self._progress.get(flow_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user