1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-27 14:31:13 +00:00

Hide FlowResultType.SHOW_PROGRESS_DONE from frontend (#107799)

* Hide FlowResultType.SHOW_PROGRESS_DONE from frontend

* Update tests
This commit is contained in:
Erik Montnemery
2024-01-16 09:04:27 +01:00
committed by GitHub
parent af6ad6be41
commit fb24e086b2
2 changed files with 62 additions and 7 deletions

View File

@@ -311,6 +311,15 @@ class FlowManager(abc.ABC):
async def async_configure(
self, flow_id: str, user_input: dict | None = None
) -> FlowResult:
"""Continue a data entry flow."""
result: FlowResult | None = None
while not result or result["type"] == FlowResultType.SHOW_PROGRESS_DONE:
result = await self._async_configure(flow_id, user_input)
return result
async def _async_configure(
self, flow_id: str, user_input: dict | None = None
) -> FlowResult:
"""Continue a data entry flow."""
if (flow := self._progress.get(flow_id)) is None:
@@ -455,7 +464,7 @@ class FlowManager(abc.ABC):
# The flow's progress task was changed, register a callback on it
async def call_configure() -> None:
with suppress(UnknownFlow):
await self.async_configure(flow.flow_id)
await self._async_configure(flow.flow_id)
def schedule_configure(_: asyncio.Task) -> None:
self.hass.async_create_task(call_configure())