core/tests/components/cast
J. Nick Koston 33ff6b5b6e
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
2024-02-18 01:07:18 +01:00
..
fixtures
__init__.py
conftest.py Bump pychromecast to 14.0.0 (#108374) 2024-02-15 20:14:01 +01:00
test_config_flow.py Switch formatting from black to ruff-format (#102893) 2023-11-27 14:38:59 +01:00
test_helpers.py Use builtin TimeoutError [a-d] (#109678) 2024-02-05 11:31:33 +01:00
test_home_assistant_cast.py Bump pychromecast to 14.0.0 (#108374) 2024-02-15 20:14:01 +01:00
test_media_player.py Avoid creating tasks for checking integrations platforms (#110795) 2024-02-18 01:07:18 +01:00