* Refactor state_reported listener setup to avoid merge in async_fire_internal
Instead of merging the listeners in async_fire_internal, setup the listener for
state_changed at the same time so async_fire_internal can avoid having to copy
another list
* Refactor state_reported listener setup to avoid merge in async_fire_internal
Instead of merging the listeners in async_fire_internal, setup the listener for
state_changed at the same time so async_fire_internal can avoid having to copy
another list
* tweak
* tweak
* tweak
* tweak
* tweak
* Speed up async_get_loaded_integrations
Use a setcomp and difference to find the components to split
to avoid the loop. A setcomp is inlined in python3.12 so its
much faster
* Speed up async_get_loaded_integrations
Use a setcomp and difference to find the components to split
to avoid the loop. A setcomp is inlined in python3.12 so its
much faster
* simplify
* fix compat
* bootstrap
* fix tests
* Reduce timestamp function call overhead in core states
The recorder or the websocket_api will always call the timestamps, so we will set the timestamp values when creating the State to avoid the function call overhead in the property we know will always be called.
* Reduce timestamp function call overhead in core states
The recorder or the websocket_api will always call the timestamps, so we will set the timestamp values when creating the State to avoid the function call overhead in the property we know will always be called.
* reduce scope of change since last_reported is not called in websocket_api
* reduce scope of change since last_reported is not called in websocket_api
* Add thread safety checks to async_create_task
Calling async_create_task from a thread almost always results in an
fast crash. Since most internals are using async_create_background_task
or other task APIs, and this is the one integrations seem to get wrong
the most, add a thread safety check here
* Add thread safety checks to async_create_task
Calling async_create_task from a thread almost always results in an
fast crash. Since most internals are using async_create_background_task
or other task APIs, and this is the one integrations seem to get wrong
the most, add a thread safety check here
* missed one
* Update homeassistant/core.py
* fix mocks
* one more internal
* more places where internal can be used
* more places where internal can be used
* more places where internal can be used
* internal one more place since this is high volume and was already eager_start
* Small improvement to service validation exception test and translation key
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Refactor string assertion
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Make release channel a hardcoded enum rather than a free form string
* Update enum comparison to remove equality and us identity comparison
* Fix comparison condition to match the previous implementation
* Update tests to use Enum instead of string
* Keep track of top level components
Currently we have to do a set comp for icons, translations,
and integration platforms every time to split the top level
components from the platforms. Keep track of the top level
components in a seperate set so avoid having to do the setcomp
every time.
* remove impossible paths
* remove unused code
* preen
* preen
* fix
* coverage and fixes
* Update homeassistant/core.py
* Update homeassistant/core.py
* Update tests/test_core.py
* DNM: Make run_immediately the default for listeners
This is a test to see how much progress we have made twords this goal
https://github.com/home-assistant/core/pull/113727#issuecomment-2004587947
* fix shutdown
* Revert "fix shutdown"
This reverts commit a8969d7db9.
* set false since it break utility meter tests
* one more
* fix rfxtrx test
* test needs to be explict now
* fix matrix
* fail sooner
* Mark executor jobs as background unless created from a tracked task
If the current task is not tracked the executor job should not
be a background task to avoid delaying startup and shutdown.
Currently any executor job created in a untracked task or
background task would end up being tracked and delaying
startup/shutdown
* import exec has the same issue
* Avoid tracking import executor jobs
There is no reason to track these jobs as they are always awaited
and we do not want to support fire and forget import executor jobs
* fix xiaomi_miio
* lots of fire time changed without background await
* revert changes moved to other PR
* more
* more
* more
* m
* m
* p
* fix fire and forget tests
* scrape
* sonos
* system
* more
* capture callback before block
* coverage
* more
* more races
* more races
* more
* missed some
* more fixes
* missed some more
* fix
* remove unneeded
* one more race
* two