J. Nick Koston
35533407fe
Improve performance of counting and iterating states in templates ( #40250 )
...
Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
2020-09-26 11:36:47 -05:00
J. Nick Koston
251d8919ea
Add domain filter support to async_all to match async_entity_ids ( #39725 )
...
This avoids copying all the states before applying
the filter
2020-09-06 23:20:32 +02:00
Paulus Schoutsen
51a63c1fc4
Drop last bits of asyncio.coroutine ( #39280 )
2020-08-26 16:57:52 +02:00
Bas Nijholt
0427d87ba4
Bump codespell from v1.16.0 to v1.17.1 and fix new spelling errors ( #38663 )
2020-08-08 14:41:02 +02:00
Pascal Vizeli
c291d4aa7d
Intelligent timeout handler for setup/bootstrap ( #38329 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-05 14:58:19 +02:00
J. Nick Koston
b3fd8a8343
Fix flapping chained task logging test ( #38492 )
2020-08-03 15:01:15 +02:00
J. Nick Koston
03582402fa
Add debug logging for when a chain of tasks blocks startup ( #38311 )
...
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-07-28 18:24:29 +02:00
J. Nick Koston
a7459b3126
Log which task is blocking startup when debug logging is on ( #38134 )
...
* Log which task is blocking startup when debug logging for homeassistant.core is on
* test needs to go one level deeper now
2020-07-23 20:03:42 -06:00
J. Nick Koston
d7811a4adf
Avoid generating a Context() object every second ( #38085 )
...
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
2020-07-22 21:52:10 -07:00
Paulus Schoutsen
8ed1a29c82
Drop white blacklist pt1 ( #37816 )
2020-07-13 17:43:11 +02:00
Joakim Plate
bcd604eec2
Detect lingering threads after tests ( #37270 )
...
* 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>
2020-07-09 16:15:14 +02:00
Paulus Schoutsen
f49ce5d1b4
Protect loop set default executor ( #37438 )
...
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-06 15:58:53 -07:00
Aaron Bach
7968cd650a
Add concept of allowed external URLs to config ( #36988 )
...
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-06-24 17:37:01 -07:00
Paulus Schoutsen
de12c21ce7
Fire config changed event during start ( #36812 )
2020-06-15 15:22:53 -07:00
J. Nick Koston
578d4a9b6a
Make the frontend available sooner (Part 1 of 2) ( #36263 )
...
* 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
2020-06-02 13:54:11 -05:00
Pascal Vizeli
ed014e3c96
Revert "Ensure frontend is available if integrations fail to start - Part 1 of 2 ( #36093 )" ( #36251 )
...
This reverts commit fbe7b4ddfa
.
2020-05-29 10:18:39 +02:00
J. Nick Koston
fbe7b4ddfa
Ensure frontend is available if integrations fail to start - Part 1 of 2 ( #36093 )
...
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-05-28 21:09:07 -07:00
Franck Nijhof
d3ae8a938c
Fix handling of additional data in core config storage ( #35660 )
2020-05-16 13:31:15 +02:00
Franck Nijhof
e56dd8ed50
Detect use of deprecated base_url ( #35353 )
...
* Detect use of deprecated base_url
* Update get_url helper
* Update core migration
* Migrate all tests
2020-05-08 17:52:32 +02:00
Franck Nijhof
2223592486
Add get_url helper, deprecate base_url ( #35224 )
2020-05-08 02:29:47 +02:00
Paulus Schoutsen
ec47216388
Use built-in test helpers on 3.8 ( #34901 )
2020-04-30 13:29:50 -07:00
Franck Nijhof
98a2efcbab
Collection of random (mainly) test improvements ( #33733 )
2020-04-06 12:51:48 +02:00
Franck Nijhof
03dd92d51b
Use set literals in tests ( #33669 )
2020-04-05 02:20:09 +02:00
Phil Bruckner
bf1b408038
Handle cancellation in ServiceRegistry.async_call ( #33644 )
2020-04-04 15:36:33 -07:00
David F. Mulcahey
bcd1eb952c
RFC - Add a 3rd state to the HA shutdown sequence for writing… ( #33358 )
...
* 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
2020-03-30 10:18:39 -07:00
Paulus Schoutsen
07fa844c43
Speed up validate_entity_id ( #32137 )
...
* Speed up validate_entity_id
* Add some more invalid entity IDs
* Adjust regular expression
* Extend and sort test cases
* Update regular expression, more cases, faster
* Adjust tests, allow start with number, disallow double underscore
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2020-02-24 08:35:02 -08:00
Paulus Schoutsen
beee1298c5
Extend safe mode ( #31927 )
...
* Extend safe mode
* Add safe mode boolean to config JSON output and default Lovelace
* Add safe mode to frontend
* Update accent color
2020-02-18 11:52:38 -08:00
Paulus Schoutsen
12de3f1e47
Clean up frontend services and events ( #31654 )
...
* Clean up frontend services and events
* Fix bug in core instead
* Add test that core works correctly with callback marked async funcs
2020-02-09 19:47:16 -08:00
Ville Skyttä
5e2ba2eb77
Enable some more bandit checks ( #30857 )
...
* Enable B108 (hardcoded tmp dir), address findings
* Enable B602 (subprocess popen with shell), address findings
* Enable B604 (start process with shell), address findings
* Enable B306 (mktemp), B307 (eval), and B325 (tempnam), no issues to address
2020-01-20 18:44:55 +02:00
Ville Skyttä
fa4fa30461
Various string cleanups ( #30435 )
...
* Remove some unnecessary string concatenations
* Replace some simple str.formats with f-strings
* Replace some string concatenations with f-strings
2020-01-03 14:47:06 +01:00
Bas Nijholt
f60125b5c9
Sort imports according to PEP8 for 'tests' ( #29791 )
2019-12-09 16:52:24 +01:00
Pascal Vizeli
c1851a2d94
Cleanup coroutine threadsafe ( #27080 )
...
* Cleanup coroutine threadsafe
* fix lint
* Fix typing
* Fix tests
* Fix black
2019-10-01 16:59:06 +02:00
Paulus Schoutsen
4de97abc3a
Black
2019-07-31 12:25:30 -07:00
Paulus Schoutsen
b90636f640
Update home zone when core config updated ( #24237 )
...
* Update home zone when core config updated
* Lint
2019-05-31 23:03:45 -07:00
Paulus Schoutsen
f995ab9d54
Don't pass in loop ( #23984 )
...
* Don't pass in loop
* Revert some changes
* Lint + Axis revert
* reinstate loop
* Fix a test
* Set loop
* Update camera.py
* Lint
2019-05-22 21:09:59 -07:00
Paulus Schoutsen
9e96397e6a
Require core config detection to be triggerd manually ( #24019 )
...
* Detect core config
* Remove elevation
* Lint
* Lint
* Fix type
2019-05-22 17:24:46 -07:00
Erik Montnemery
afe9fc221e
Fire event when core config is updated ( #23922 )
...
* Fire event when core config is updated
2019-05-20 20:02:36 +02:00
Erik Montnemery
c2fc8a0d61
Load HA core config from storage ( #23872 )
...
* Load HA core config from storage
* Tweak
* Lint, review comments
* Fix test
* Add tests
* Lint
* Address comments
2019-05-16 16:27:53 +02:00
Andrew Sayre
02d8731a61
Add HEOS sign-in/out services ( #23729 )
...
* Add HEOS sign-in/out services
* Fix typo in comment
2019-05-07 09:39:42 -07:00
Jason Hu
f1b867dccb
Re-thrown exception occurred in the blocking service call ( #21573 )
...
* Rethrown exception occurred in the actual service call
* Fix lint and test
2019-03-01 23:09:31 -08:00
Paulus Schoutsen
52f337ef00
Allow chaining contexts ( #21028 )
...
* Allow chaining contexts
* Add stubbed out migration
2019-03-01 10:08:38 -08:00
Paulus Schoutsen
cf3a8b60ff
Prevent invalid context from crashing ( #21231 )
...
* Prevent invalid context from crashing
* Lint
2019-02-20 08:02:56 +01:00
Paulus Schoutsen
d2fea76fd7
Add context to service call event ( #21181 )
2019-02-18 13:07:44 -08:00
Jason Hu
8137b0bb9e
Fix coroutine never awaited warning in test ( #20892 )
2019-02-09 15:13:12 -06:00
Andrew Sayre
e73569c203
Added partial detection to async_add_job ( #20119 )
2019-01-14 15:08:44 -08:00
Paulus Schoutsen
59581786d3
Add raw service data to event ( #19163 )
2018-12-10 12:58:51 +01:00
Paulus Schoutsen
df21dd21f2
RFC: Call services directly ( #18720 )
...
* Call services directly
* Simplify
* Type
* Lint
* Update name
* Fix tests
* Catch exceptions in HTTP view
* Lint
* Handle ServiceNotFound in API endpoints that call services
* Type
* Don't crash recorder on non-JSON serializable objects
2018-11-30 21:28:35 +01:00
Paulus Schoutsen
08fe7c3ece
Pytest tests ( #17750 )
...
* Convert core tests
* Convert component tests to use pytest assert
* Lint 🤷♂️
* Fix test
* Fix 3 typos in docs
2018-10-24 12:10:05 +02:00
Anders Melchiorsen
0bf10b0b09
Fire an event when timer gets out of sync ( #17398 )
2018-10-15 11:34:36 +02:00
Anders Melchiorsen
3e0c6c176a
Rework timer delays ( #16650 )
...
* Calibrate timer for each tick
* Return of timer out of sync detection
2018-09-17 10:10:50 +02:00