1370 Commits

Author SHA1 Message Date
Pascal Vizeli
72a6251042
V2 timeout for async_add_entities (#38601)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-08-07 08:36:38 +02:00
Pascal Vizeli
896bdbff8f
Revert "Add a timeout for async_add_entities (#38474)" (#38584)
This reverts commit 7590af393077fbee840a7e91921717a4b699a553.
2020-08-06 09:32:42 +02:00
J. Nick Koston
7590af3930
Add a timeout for async_add_entities (#38474) 2020-08-05 18:06:21 +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
62c664fbbd
Reduce time to reload yaml and check configuration (#38469)
* Reduce time to reload yaml and check configuration

We spend a significant amount of time compiling templates
that we have already compiled.

Use an LRU cache to avoid re-compiling templates that
we frequently use.

* pylint

* switch to WeakValueDictionary

* preen
2020-08-04 03:00:44 +02:00
Phil Bruckner
c3a820c4a3
Fix queued script not updating current attribute when queuing (#38432) 2020-08-01 15:51:48 +02:00
J. Nick Koston
fe69a85386
Improve logging when a unique id conflict is detected (#38434)
* fix error when unique id is re-used

* add test for the logging

* Update homeassistant/helpers/entity_platform.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/helpers/entity_platform.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-08-01 11:20:37 +02:00
Ville Skyttä
c2a21fa496
Update coordinator improvements (#38366)
* Make generic

* Add type info to bunch of uses

* Recognize requests exceptions

* Recognize urllib exceptions
2020-07-30 18:04:00 +03:00
Phil Bruckner
1158925b53
Fix repeat action when variables present (#38237) 2020-07-27 16:51:34 -05:00
Phil Bruckner
1a760c63d0
Fix parallel script containing repeat or choose action with max_runs > 10 (#38243) 2020-07-27 10:43:58 +02:00
J. Nick Koston
34d01d5e47
Mark event tests to run as callbacks (#38212)
* Mark event tests to run as callbacks

* revert change to same state check that is expected to run in a thread
2020-07-25 17:52:48 -10:00
J. Nick Koston
b868f13591
Ensure all track time change tests mock a specific start time (#38178)
* Ensure all track time change tests mock a specific start time

* make sure tests calling async_track_utc_time_change fire time in utc
2020-07-24 19:04:36 -07:00
Phil Bruckner
2f87da8aa9
Fix script repeat variable lifetime (#38124) 2020-07-23 23:11:21 -07: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
Phil Bruckner
65d1dfba62
Update automation logger to include object_id like scripts (#37948) 2020-07-22 10:55:49 -05:00
Phil Bruckner
726d5fdd94
Allow float values in time periods (#38023) 2020-07-21 19:41:42 -05:00
J. Nick Koston
4015991622
Update tests that track time to account for microsecond precision (#38044) 2020-07-21 14:22:55 -07:00
J. Nick Koston
60009ec2f9
Use event loop scheduling for tracking time patterns (#38021)
* Use event loop scheduling for tracking time patterns

* make patching of time targetable

* patch time tests since time can tick to match during the test

* fix more tests

* time can only move forward

* time can only move forward

* back to 100% coverage

* simplify since the event loop time cannot move backwards

* simplify some more

* revert simplify

* Revert "revert simplify"

This reverts commit bd42f232f6f4e0876fbfe7ce5abf363779761acd.

* Revert "simplify some more"

This reverts commit 2a6c57d51487d4fc85140033a5cadbc800e61287.

* Revert "simplify since the event loop time cannot move backwards"

This reverts commit 3b13714ef489b5c5661ae0254b12f137d047fc26.

* Attempt another simplify

* time does not move backwards in the last two

* remove next_time <= now check

* fix previous merge error
2020-07-20 20:18:31 -10:00
J. Nick Koston
6ea5c8aed9
Index the device registry (#37990) 2020-07-19 23:32:05 -07:00
J. Nick Koston
890562e3ae
Index the entity registry (#37994) 2020-07-19 22:52:41 -07:00
J. Nick Koston
910b6c9c2c
Index entity_registry_updated listeners (#37940) 2020-07-17 21:59:18 -07:00
J. Nick Koston
fa4e9c0485
Increase test line coverage of homeassistant/helpers/event.py to 100% (#37927)
* Increase test line coverage of homeassistant/helpers/event.py to 100%

* fix test
2020-07-16 21:47:53 -07:00
J. Nick Koston
b6befa2e83
Ensure a state change tracker setup from inside a state change listener does not fire immediately (#37924)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-16 17:50:06 -07:00
Phil
21649244e9 Update per review 3 2020-07-15 16:58:42 +00:00
Phil
741c702ff3 Add tests 2020-07-15 16:58:42 +00:00
Bram Kragten
7d77fa92c2
Add mode info attributes to script and automation (#37815)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-14 10:47:59 -07:00
Phil Bruckner
7e280e2b27
Add choose script action (#37818)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-07-14 10:22:54 -07:00
Jakob Schlyter
dbcd5f4c2c
Add urlencode template filter (#37753)
* add urlencode template filter

* fix flake8

* add test to string ang integer

* better test vectors
2020-07-13 16:48:29 +02:00
Phil Bruckner
e5a081c7dd
Fix script queued mode typo (#37759) 2020-07-11 13:34:53 -05:00
Phil Bruckner
63e55bff52
Remove legacy script mode and simplify remaining modes (#37729) 2020-07-10 17:00:57 -07:00
Rohan Kapoor
0db8140c13
Add support for the DataUpdateCoordinator to not automatically update (#37734) 2020-07-10 15:48:20 -07:00
Phil Bruckner
91271f388c
Add new repeat loop for scripts and automations (#37589) 2020-07-10 13:37:19 -05:00
J. Nick Koston
34ccb6588c
Cleanup async_track_state_change and augment docstring (#37251)
* Cleanup async_track_state_change and augment docstrings.

Skip from_state and to_state matching in
async_track_state_change when they are None

Optimize the state change listener for the most
common use case: no to_state and from_state
matching.

* Update benchmark to be more realistic (previously we assumed only one entity was present in the whole instance)

* Add more tests to ensure behavior is preserved

* Ensure new behavior matches test

* remove MATCH_ALL from zone automation since its the default anyways

* Might as well use async_track_state_change_event instead since MATCH_ALL is removed
2020-07-05 17:31:33 -05:00
J. Nick Koston
c03832da63
Fix entity_component test flapping (#37445) 2020-07-04 16:55:44 +02:00
Kevin Eifinger
eb66da6436
Add helpers.location.coordinates (#37234) 2020-07-03 11:28:44 -07:00
Paulus Schoutsen
d08d00daa7
Limit entity platform entity service to same integration (#37313) 2020-07-02 11:39:53 +02:00
J. Nick Koston
89a9634d35
Use eventloop for scheduling (#37184)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-29 09:39:24 -07:00
J. Nick Koston
a63a11a11a
Ensure all async_track_state_change_event callbacks run if one throws (#37179) 2020-06-27 17:48:27 -07:00
J. Nick Koston
4acc6f333e
Improve scalability of state change event routing (#37174) 2020-06-27 14:46:45 -07:00
mdegat01
6c7355785a
Add support for glob matching to entity filters (#36913)
* Added GLOB capability to entityfilter and every place that uses it. All existing tests are passing

* added tests for components affected by glob change

* fixed flake8 error

* mocking the correct listener

* mocking correct bus method in azure test

* tests passing in 3.7 and 3.8

* fixed formatting issue from rebase/conflict

* Checking against glob patterns in more performant way

* perf improvments and reverted unnecessarily adjusted tests

* added new benchmark test around filters

* no longer using get with default in entityfilter

* changed filter name and removed logbook from filter benchmark

* simplified benchmark tests from feedback

* fixed apache tests and returned include exclude schemas to normal

* fixed azure event hub tests to properly go through component logic

* fixed azure test and clean up for other tests

* renaming test files to match standard

* merged mqtt statestream test changes with base

* removed dependency on recorder filter schema from history

* fixed recorder tests after merge and a bunch of lint errors
2020-06-23 20:02:29 -05:00
J. Nick Koston
152a80abed
Complete deprecation of hidden attribute (ATTR_HIDDEN) (#37041) 2020-06-23 17:05:32 -05:00
Franck Nijhof
8b21b415c4
Fix/Rewrite of Toon integration (#36952)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-22 18:22:41 -07:00
Franck Nijhof
02f174e2e6
Add support for multiple states/zones in conditions (#36835)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-16 00:53:13 +02:00
Franck Nijhof
ba73ac12ba
Add support for multiple entity_ids in conditions (#36817) 2020-06-15 22:54:19 +02:00
Erik Montnemery
922b332766
Update config_entry_flow test test_user_has_confirmation (#36633)
* Update test_user_has_confirmation

* Rewrite test according to review comment
2020-06-13 06:43:13 +02:00
Paulus Schoutsen
1ffa8fcbba
Platforms cleanup when adding entity fails (#36742) 2020-06-12 17:54:46 -07:00
Erik Montnemery
14bff5a375
Abort other config flows on import (#36608)
* Abort other flows on import

* Add test
2020-06-10 22:46:14 +02:00
Paulus Schoutsen
8f3c84b349
Mark config dependency of frontend (#36587) 2020-06-09 23:27:47 -07:00
Ville Skyttä
29b8f76e57
Use past tense in messages for already invalidated deprecated configs (#36591) 2020-06-09 23:26:55 -07:00
Erik Montnemery
7722e417ad
Stable device id when a deleted device is restored (#36309)
* Stable device id when a deleted device is restored.

* Tweak

* Store only basic data for deleted devices

* Simplify code

* Simplify code

* Address review comments.

* Improve test

* Fix missing save
2020-06-02 21:22:08 +02:00