Chris Browet
e961d92b5e
Allow service data template to return a dict ( #57105 )
2021-10-23 21:10:30 +02:00
Richard T. Schaefer
9e219d9b6e
Add this variable for use by automation and script templates ( #52774 )
2021-07-28 09:09:13 +02:00
Erik Montnemery
b01b33c304
Add trigger condition ( #51710 )
...
* Add trigger condition
* Tweaks, add tests
2021-06-11 15:05:57 +02:00
Paulus Schoutsen
a59460a233
Test that we do not initialize bad configuration ( #48872 )
...
* Test that we do not initialize bad configuration
* Simplify test as we are not calling a service
2021-04-08 22:04:39 +02:00
Paulus Schoutsen
f67e8b4369
Populate trigger variable when manually triggering automation ( #48202 )
...
* Populate trigger variable when manually triggering automation
* Update tests/components/automation/test_init.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-03-22 08:22:32 +01:00
Paulus Schoutsen
7c2545af6e
Use async_capture_events to avoid running in executor ( #47111 )
2021-02-26 13:28:52 -08:00
Anders Melchiorsen
48002f47f4
Use caplog fixture for log capturing ( #46214 )
2021-02-08 14:33:57 +01:00
Erik Montnemery
047f16772f
Support templating MQTT triggers ( #45614 )
...
* Add support for limited templates (no HASS access)
* Pass variables to automation triggers
* Support templates in MQTT triggers
* Spelling
* Handle trigger referenced by variables
* Raise on unsupported function in limited templates
* Validate MQTT trigger schema in MQTT device trigger
* Add trigger_variables to automation config schema
* Don't print stacktrace when setting up trigger throws
* Make pylint happy
* Add trigger_variables to variables
* Add debug prints, document limited template
* Add tests
* Validate MQTT trigger topic early when possible
* Improve valid_subscribe_topic_template
2021-02-08 10:50:38 +01:00
Anders Melchiorsen
b9b1caf4d7
Raise ConditionError for numeric_state errors ( #45923 )
2021-02-08 10:47:57 +01:00
Marc Mueller
7673f57248
Add additional error handling for automation script run ( #45613 )
2021-01-28 09:26:41 +01:00
Franck Nijhof
65cf2fcb6f
Drop asynctest ( #44746 )
2021-01-01 22:31:56 +01:00
Paulus Schoutsen
ac2af69d26
Fix extracting entity and device IDs from scripts ( #44048 )
...
* Fix extracting entity and device IDs from scripts
* Fix extracting from data_template
2020-12-08 13:06:29 +01:00
Paulus Schoutsen
0fb587727c
Add initial blueprint support ( #42469 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-11-02 15:00:13 +01:00
Franck Nijhof
8837ed35cd
Use direct service calls in tests instead of automation common ( #40623 )
...
* Use direct service calls in tests instead of automation common
* Remove automation common test helpers
2020-09-26 19:28:26 +02:00
Paulus Schoutsen
5117a16841
Extract variable rendering ( #39934 )
2020-09-11 12:24:16 +02:00
Paulus Schoutsen
aa9dff572e
Add default variables to script helper ( #39895 )
2020-09-10 20:41:42 +02:00
Franck Nijhof
a3c45a6f89
Add shorthand notation for Template conditions ( #39705 )
2020-09-06 16:55:06 +02:00
Phil Bruckner
b315df2118
Reduce automation state changes by using script helper's last_triggered attribute ( #39323 )
2020-08-28 14:51:15 -05:00
Phil Bruckner
e6141ae558
Add description of what caused an automation trigger to fire ( #39251 )
...
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-28 17:02:12 +02:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 ( #39287 )
2020-08-27 13:56:20 +02:00
J. Nick Koston
6b7a7939d2
Include the first seen context data in the logbook api ( #39194 )
...
* Include the context_entity_id in the logbook api
context_entity_id is the first entity seen during
a time period that includes the context
* update test
* more of them
* include friendly name
* pylint wants a ternary
* Refactor
* performance
* fix homekit context
* Fix self describing events
* Fix external_events
2020-08-24 12:44:40 -05:00
Phil Bruckner
ca9dd0c833
Reorganize trigger code ( #38655 )
2020-08-17 11:54:56 -05:00
Phil Bruckner
9e12e3f96c
Allow automation to be turned off without stopping actions ( #38436 )
2020-08-01 21:31:47 -05:00
Phil Bruckner
bbc8748e3b
Stop automation runs when turned off or reloaded ( #38174 )
...
* Add automation turn off / reload test
* Stop automation runs when turned off or reloaded
2020-07-25 12:19:55 +02:00
Phil Bruckner
63e55bff52
Remove legacy script mode and simplify remaining modes ( #37729 )
2020-07-10 17:00:57 -07:00
Phil Bruckner
91271f388c
Add new repeat loop for scripts and automations ( #37589 )
2020-07-10 13:37:19 -05:00
Phil Bruckner
f7c4900d5c
Enhance automation integration to use new features in script helper ( #37479 )
2020-07-05 09:25:15 -05:00
Paulus Schoutsen
5bc6ed4cef
Add logbook platforms ( #37078 )
...
* Add logbook platforms
* Fix logbook describe test
2020-06-24 18:14:50 -07:00
J. Nick Koston
59e43ab6e4
Prefilter more logbook events in sql ( #36958 )
...
* Prefilter more logbook events in sql
Prefilter sensor events in _keep_event before humanify
Cache static attribute lookup
Reduces logbook execution time by ~35%
* fix mocking in benchmark
* Update tests for logbook users
2020-06-21 10:50:58 -07:00
J. Nick Koston
0a219081ea
Only process logbook timestamps for events we will keep ( #36792 )
...
* Only process logbook timestamps for events we will keep
Since we group by minute we were previously processing
every timestamp. We can avoid this by making all the
minute checks use the unprocessed datetime since
the groupings will be the same regardless of timezone.
This reduces the number of datetime object recreations
by at least an order of magnitude.
2020-06-15 14:54:20 -05:00
Franck Nijhof
e6fe34e64d
Migrate automation to use describe_event for logbook ( #36356 )
2020-06-01 17:18:40 -07:00
Franck Nijhof
1883b1d2a2
Add config reloaded events for automation and scene ( #34664 )
2020-06-01 15:19:00 -07:00
Paulus Schoutsen
2af984917e
Use asynctest-mock in most places ( #35109 )
...
* Use asynctest-mock in most places
* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Franck Nijhof
8c65062271
Several optimizations to automations ( #35007 )
2020-05-01 16:37:25 +02:00
Paulus Schoutsen
77443b3d09
Add Home Assistant Started event ( #34657 )
2020-04-24 14:13:39 -07:00
Paulus Schoutsen
67680bcfa8
Automation device/entity extraction to include triggers + conditions ( #31474 )
...
* Add support for extracting triggers
* Add support for extracting triggers
* Fix test
2020-02-05 16:52:21 +01:00
Paulus Schoutsen
424e15c7a7
Find related items scripts/automations ( #31293 )
...
* Find related items scripts/automations
* Update manifest
2020-01-29 16:19:13 -08:00
Christian Clauss
1d537ad416
Fix typo: serivce --> service ( #31217 )
2020-01-27 19:56:26 +01:00
Paulus Schoutsen
5fdc60e067
Add Safe Mode ( #30723 )
...
* Store last working HTTP settings
* Add safe mode
* Fix tests
* Add cloud to safe mode
* Update logging text
* Fix camera tests leaving files behind
* Make emulated_hue tests not leave files behind
* Make logbook tests not leave files behind
* Make tts tests not leave files behind
* Make image_processing tests not leave files behind
* Make manual_mqtt tests not leave files behind
2020-01-14 13:03:02 -08:00
Santobert
3d7488d188
Trigger automation without skipping condition ( #28484 )
...
* Trigger automation without skipping condition
* [] instead of .get()
* Update __init__.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-08 10:36:11 +01:00
Paulus Schoutsen
9aa02e35a7
Entity Component to no longer generate automatic groups ( #23789 )
2020-01-07 17:30:53 +01:00
Alexei Chetroi
ccb0fd5e32
Register automation.reload service as an admin service. ( #29582 )
...
* homeassistant/components/automation/__init__.py
* Register automation.reload as an admin service.
2019-12-07 21:17:30 +01:00
Erik Montnemery
42691b783e
Handle empty service in script action gracefully ( #27467 )
...
* Handle empty service in script action gracefully
* Add test
2019-10-12 12:28:47 -07:00
Paulus Schoutsen
4de97abc3a
Black
2019-07-31 12:25:30 -07:00
Franck Nijhof
d648eb1e4f
Minor improvements to automation test suite ( #24424 )
...
* Minor improvements to automation test suite
* Removes unused asyncio imports
* Removes some vars that are not needed
2019-06-08 19:10:23 -05:00
Franck Nijhof
9235b52828
Restore automation last_triggered with initial_state override ( #24400 )
...
* Restore automation last_triggered with initial_state override
* Made test async/await
* Fixes linter warning
* Update test_init.py
2019-06-08 12:48:36 -07:00
Paulus Schoutsen
7887d6d6e4
Fix automation failing to restore state ( #24390 )
...
* Fix automation off
* Fix tests
2019-06-07 23:08:22 -07:00
Paulus Schoutsen
de1fd5a7fa
WS: Improve service calling errors ( #23840 )
...
* WS: Improve service calling errors
* Docstyle
* Types
* Update text
2019-05-14 07:09:11 +02: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
9d9e11372b
Make automations log errors ( #18965 )
2018-12-13 12:21:16 +01:00