Avoid creating tasks for checking integrations platforms (#110795)

* Avoid creating tasks for checking integrations platforms

This is a followup to #110743 to avoid creating a task to check
if the integration platform exists. We created tasks because
we needed to await async_get_integrations but since its always
called from EVENT_COMPONENT_LOADED firing, we can use the
async_get_loaded_integration version which does not need
to be awaited. This eliminates one task for every loaded
component

* there is no more race risk

* reduce

* coro or callback

* reduce

* tweak

* race safe

* fix type

* fixes

* use built-in helper to make it smaller

* use built-in helper to make it smaller

* use built-in helper to make it smaller

* add coverage to ensure exceptions are logged

* improve readability a bit

* platforms
This commit is contained in:
J. Nick Koston
2024-02-17 18:07:18 -06:00
committed by GitHub
parent a656e14b20
commit 33ff6b5b6e
4 changed files with 152 additions and 91 deletions

View File

@@ -463,6 +463,7 @@ async def test_delete_issue(
}
@pytest.mark.no_fail_on_log_exception
async def test_non_compliant_platform(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator
) -> None: