Every second we were calling the getrandom() syscall to generate a uuid4
for a context that will never be looked:
* In most setups there are no more time_changed listeners
* The ones that do exist never care about context
* time_changed events are never saved in the database
* Detect lingering threads after tests
* Make sure cast is setup before checking state
* Make sure we ask executors of old hass to shutdown
We are not waiting here, just hoping for the best
* Make sure all instances of hass and executors is stopped.
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Also apply hass stopping to scripts
* Adjust to changes how we set up executor
* Add new CoreState.stopped
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Part 1 of 2 (no breaking changes in part 1).
When integrations configured via the UI block startup or fail to start,
the webserver can remain offline which make it is impossible
to recover without manually changing files in
.storage since the UI is not available.
This change is the foundation that part 2 will build on
and enable a listener to start the webserver when the frontend
is finished loading.
Frontend Changes (home-assistant/frontend#6068)
* Address review comments
* bump timeout to 1800s, adjust comment
* bump timeout to 4h
* remove timeout failsafe
* and the test
* add third stage to hass shutdown
* use 3rd stage in storage
* update core state
* add writing data to multi stop ignore
* update core test
* review comment
* update name based on feedback
* Add context
* Add context to switch/light services
* Test set_state API
* Lint
* Fix tests
* Do not include context yet in comparison
* Do not pass in loop
* Fix Z-Wave tests
* Add websocket test without user
## Description:
Make typing checks more strict: add `--strict-optional` flag that forbids implicit None return type. This flag will become default in the next version of mypy (0.600)
Add `homeassistant/util/` to checked dirs.
## Checklist:
- [x] The code change is tested and works locally.
- [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
* Lazy loading of service descriptions
* Fix tests
* Load YAML in executor
* Return a copy of available services to allow mutations
* Remove lint
* Add zha/services.yaml
* Only cache descriptions for known services
* Remove lint
* Remove description loading during service registration
* Remove description parameter from async_register
* Test async_get_all_descriptions
* Remove lint
* Fix typos from multi-edit
* Remove unused arguments
* Remove unused import os
* Remove unused import os, part 2
* Remove unneeded coroutine decorator
* Only use executor for loading files
* Cleanups suggested in review
* Increase test coverage
* Fix races in existing tests
* Recorder exception catch for long state string
* Revert - Recorder exception catch for long state string
* Validate state length at core level
* Revert - this reverts commit 9d6bd017d9.
* Revert - Recorder exception catch for long state string
* Fix state TypeError
* Test for long state exception
* Add support for remove services / Reload script support
* Reload support for scripts
* Add more unittest for services
* Add unittest for script reload
* Address paulus comments
* Core cleanup: two stage shutdown
* fix spell
* fix
* add async logger to close
* change aiohttp to use CLOSE
* address paulus comments
* Fix tests
* Add unittest
* Move core servcie from core to components
* add new handler for signals/exception
* Static persistent id
* Move unittest
* fix coro/callback
* Add more unittest for new services
* Address comments
* Update __init__.py
* Check config before restarting.
* Make check_config on restart async
* don't check if notification service exists
* Use .communicate()
* Reduce the number of notifications. Add tests.
* Lazy initialise the worker pool
* Minimize pool initialization in core tests
* Fix tests on Python 3.4
* Remove passing in thread count to mock HASS
* Tests: Allow pool by default for threaded, disable for async
* Remove JobPriority for thread pool
* Fix wrong block_till_done
* EmulatedHue: Remove unused test code
* Zigbee: do not touch hass.pool
* Init loop in add_job
* Fix core test
* Fix random sensor test
* Bugfix signhandling/services
* change from coroutine to callback
* add error handling
* fix bug with endless running
* fix unit test
* Revert "fix unit test"
This reverts commit 31135c7709.
* Disable sigterm/sighup test
* Add async_safe annotation
* More async_run_job
* coroutine -> async_save
* Lint
* Rename async_safe -> callback
* Add tests to core for different job types
* Add one more test with different type of callbacks
* Fix typing signature for callback methods
* Fix callback service executed method
* Fix method signatures for callback
* Move worker pool monitoring to be time based instead of add_job based.
* Stub out worker pool monitor during tests
* Add test for monitor worker pool.
* Improve naming
* Test stop_monitor coroutine
* Add async_create_timer test
* Finish rename create_timer
* Add event loop to the core
* Add block_till_done to HA core object
* Fix some tests
* Linting core
* Fix statemachine tests
* Core test fixes
* fix block_till_done to wait for loop and queue to empty
* fix test_core for passing, and correct start/stop/block_till_done
* Fix remote tests
* Fix tests: block_till_done
* Fix linting
* Fix more tests
* Fix final linting
* Fix remote test
* remove unnecessary import
* reduce sleep to avoid slowing down the tests excessively
* fix remaining tests to wait for non-threadsafe operations
* Add async_ doc strings for event loop / coroutine info
* Fix command line test to block for the right timeout
* Fix py3.4.2 loop var access
* Fix SERVICE_CALL_LIMIT being in effect for other tests
* Fix lint errors
* Fix lint error with proper placement
* Fix slave start to not start a timer
* Add asyncio compatible listeners.
* Increase min Python version to 3.4.2
* Move async backports to util
* Add backported async tests
* Fix linting
* Simplify Python version check
* Fix lint
* Remove unneeded try/except and queue listener appproriately.
* Fix tuple vs. list unorderable error on version compare.
* Fix version tests