* Schedule periodic coordinator updates as background tasks.
Currently, the coordinator's periodic refreshes delay startup because they are not scheduled as background tasks. We will wait if the startup takes long enough for the first planned refresh. Another coordinator's scheduled refresh will be fired on busy systems, further delaying the startup. This chain of events results in the startup taking a long time and hitting the safety timeout because too many coordinators are refreshing.
This case can also happen with scheduled entity refreshes, but it's less common. A future PR will address that case.
* periodic_tasks
* periodic_tasks
* periodic_tasks
* merge
* merge
* merge
* merge
* merge
* fix test that call the sync api from async
* one more place
* cannot chain
* async_run_periodic_hass_job
* sun and pattern time changes from automations also block startup
* Revert "sun and pattern time changes from automations also block startup"
This reverts commit 6de2defa05.
* make sure polling is cancelled when config entry is unloaded
* Revert "Revert "sun and pattern time changes from automations also block startup""
This reverts commit e8f12aad55.
* remove DisabledError from homewizard test as it relies on a race
* fix race
* direct coverage
* Pre import the rest of the recorder platforms before asyncio starts
I removed these from #112131 since I had trouble with the weather
tests passing due to a race that I could not figure out. The race
seems to have gone away now (at least locally) so hopefully the CI
will pass now
* Avoid importing counter and proximity integrations in logbook
* Avoid importing counter and proximity integrations in logbook
Move analytics setup to stage 1 to avoid delaying frontend startup
analytics was only needed in the frontend startup phase for onboarding.
Its very unlikely the user will be able to complete the onboarding
steps and get to the analytics screen before analytics is done loading
so we can delay loading it until stage 1. To be absolutely sure that
it is ready, the core_config step in onboarding will wait to proceed
if it is some how still being setup
* Reduce executor jobs needed to setup filesize
Move the _get_full_path check into the coordinator so everything
can happen in the executor at setup time
* Reduce executor jobs needed to setup filesize
Move the _get_full_path check into the coordinator so everything
can happen in the executor at setup time
* Update homeassistant/components/filesize/coordinator.py
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
If the device does not need to be polled for the battery state which
is only present on portable speakers, the task will never suspend
and never need to be scheduled on the event loop