* Phase out periodic tasks
* false by default or some tests will block forever, will need to fix each one manually
* kwarg works
* kwarg works
* kwarg works
* fixes
* fix more tests
* fix more tests
* fix lifx
* opensky
* pvpc_hourly_pricing
* adjust more
* adjust more
* smarttub
* adjust more
* adjust more
* adjust more
* adjust more
* adjust
* no eager executor
* zha
* qnap_qsw
* fix more
* fix fix
* docs
* its a wrapper now
* add more coverage
* coverage
* cover all combos
* more fixes
* more fixes
* more fixes
* remaining issues are legit bugs in tests
* make tplink test more predictable
* more fixes
* feedreader
* grind out some more
* make test race safe
* one more
* 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
* Avoid duplicate timestamp conversions for websocket api and recorder
We convert the time from datetime to timestamps one per
open websocket connection and the recorder for every
state update. Only do the conversion once since its
~30% of the cost of building the state diff
* more
* two more
* two more in live history
* Avoid looking up the callable type for HassJob when we already know it
When we connect the frontend we call async_listen with run_immediately MANY
times when we already know the job type (it will always be a callback). This
reduces the latency to get the frontend going
* missing coverage
* Improve service response data APIs
Make the API naming more consistent, and require registration that a
service supports response data so that we can better integrate with
the UI and avoid user confusion with better error messages.
* Improve test coverage
* Add an enum for registering response values
* Assign enum values
* Convert SupportsResponse to StrEnum
* Update service call test docstrings
* Add tiny missing full stop in comment
---------
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* Add support for service calls with resopnse data.
Update the service calls to allow returning responses with data,
with an initial use case supporting basic service calls usable
within script.
* Revert enttiy platform/component changes
* Remove unnecessary comma diff
* Revert additional unnecessary changes
* Simplify service call
* Simplify and fix typing and revert whitespace
* Clarify typing intent
* Revert more entity service calls
* Revert additional entity service changes
* Set blocking=True for group notify service call
* Revert unnecessary changes
* Reverting more whitespace changes
* Revert more service changes
* Add test coverage for None return case
* Add parameter to service calls indicating return values were requested
* Update tests/test_core.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Add additional service call tests
* Update test comment
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Update return signature of service calls
* Add timeout error handling in websocket api for service calls
* Update recorder tests to remove assertion on service call
* Remove timeout behavior and update callers that depend on it today
* Fix tests
* Add missing else
* await coro directly
* Fix more tests
* Update the intent task to use wait instead of timeout
* Remove script service call limits and limit constants
* Update tests that depend on service call limits
* Use wait instead of wait_for and add test
* Update homeassistant/helpers/intent.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Remove as_compressed_state cache
All calls to as_compressed_state are now covered by a higher level
JSON cache so there is no need to store these in memory anymore
* Remove as_compressed_state cache
All calls to as_compressed_state are now covered by a higher level
JSON cache so there is no need to store these in memory anymore
* Restore previous behavior of only waiting for new tasks at shutdown
* cleanup
* do a swap instead
* await canceled tasks
* await canceled tasks
* fix
* not needed since we no longer clear
* log it
* reword
* wait for airvisual
* tests