1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 14:08:21 +00:00

Reduce in progress flow matching overhead (#94403)

* Reduce config flow matching overhead

Much of the config flow matching is happening on the context data
after converting via a series of functions. Avoid the conversions
by passing the context matcher deeper into the stack so only
relvant entries need to be processed.

The goal is to reduce the overhead and reduce the chance
the event loop falls behind at the started event when
all the discoveries are processed

* Reduce config flow matching overhead

Much of the config flow matching is happening on the context data
after converting via a series of functions. Avoid the conversions
by passing the context matcher deeper into the stack so only
relvant entries need to be processed.

The goal is to reduce the overhead and reduce the chance
the event loop falls behind at the started event when
all the discoveries are processed

* Reduce config flow matching overhead

Much of the config flow matching is happening on the context data
after converting via a series of functions. Avoid the conversions
by passing the context matcher deeper into the stack so only
relvant entries need to be processed.

The goal is to reduce the overhead and reduce the chance
the event loop falls behind at the started event when
all the discoveries are processed

* augment cover
This commit is contained in:
J. Nick Koston
2023-06-11 01:41:38 -07:00
committed by GitHub
parent 41d8ba3397
commit 9e666ae0c0
3 changed files with 73 additions and 31 deletions

View File

@@ -462,6 +462,22 @@ async def test_async_has_matching_flow(
assert result["progress_action"] == "task_one"
assert len(manager.async_progress()) == 1
assert len(manager.async_progress_by_handler("test")) == 1
assert (
len(
manager.async_progress_by_handler(
"test", match_context={"source": config_entries.SOURCE_HOMEKIT}
)
)
== 1
)
assert (
len(
manager.async_progress_by_handler(
"test", match_context={"source": config_entries.SOURCE_BLUETOOTH}
)
)
== 0
)
assert manager.async_get(result["flow_id"])["handler"] == "test"
assert (