Commit Graph

152 Commits (b0704c190f6d1096efb0889c7c307820c78071d5)

Author SHA1 Message Date
Ruslan Sayfutdinov 55f4962c06
Fix pylint plugin which checks relative imports (#62693) 2021-12-23 11:14:47 -08:00
Erik Montnemery e48f567176
Wrap shorthand template conditions during schema validation (#62485) 2021-12-21 17:20:15 +01:00
Ville Skyttä 334c6c5c02
Make device automation type an enum (#62354) 2021-12-20 19:16:30 +01:00
Erik Montnemery 112e259437
Fix threading error in scripts with repeat or choose actions (#62168) 2021-12-17 11:41:54 +01:00
Erik Montnemery 17dc609363
Correct validation of conditions in scripts and automations (#60890)
* Correct validation of conditions in scripts and automations

* Fix test
2021-12-03 09:08:28 -08:00
Erik Montnemery caf5ee2fab
Remove optional validation when creating conditions (#60481) 2021-11-28 14:54:07 +01:00
Erik Montnemery ea102f71a6
Correct validation of repeats in scripts and automations (#60318)
* Correct validation of repeats in scripts and automations

* Improve validation test
2021-11-26 14:12:59 +01:00
Erik Montnemery ad9c3a47cf
Correct validation of conditions in scripts and automations (#60403) 2021-11-26 13:21:11 +01:00
J. Nick Koston 10d6247fee
Bump to aiohttp 3.8.0 (#58974) 2021-11-04 10:07:50 -05:00
Marc Mueller 238b488642
Use assignment expressions 03 (#57710) 2021-10-17 20:08:11 +02:00
Paulus Schoutsen 835e07f63e
Remove debug log (#57619) 2021-10-13 13:03:52 -07:00
Erik Montnemery 007af4a7aa
Search for areas, devices and entities in script choose actions (#57554) 2021-10-12 08:49:07 -07:00
Marc Mueller 77ee72cbb9
Import Callable from collections.abc (1) (#56775) 2021-09-29 16:32:11 +02:00
Marc Mueller 46c3495ae0
Update pylint to 2.9.5 (#53496) 2021-07-26 16:17:15 +02:00
Marc Mueller f6b162bc39
Add pylint CodeStyle extension (#53147) 2021-07-19 06:57:06 -07:00
Ville Skyttä 470f2dd73f
Upgrade pyupgrade to 2.21.2, apply its changes (#52987) 2021-07-19 10:46:09 +02:00
Raman Gupta bef8be9256
Support dynamic schema validation in device conditions and actions (#52007)
* Allow integrations to provide dynamic schema validation in device conditions and actions

* Add tests

* re-add type

* mypy
2021-06-28 09:23:46 +02:00
Erik Montnemery 1ea0d8ae02
Correct trace of condition actions (#50800) 2021-05-17 16:54:17 -07:00
Erik Montnemery b35f229674
Include _StopScript.__cause__ in trace (#50441)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-05-11 22:27:11 -07:00
Marc Mueller c07646db5d
Update typing syntax (#49480)
* Update typing syntax

* Replace typing imports with ones from collections where possible

* Changes after review
2021-04-20 17:40:41 +02:00
Erik Montnemery a968dea152
Fix deadlock when restarting scripts (#49410) 2021-04-19 14:45:01 +02:00
Ville Skyttä 970cbcbe15
Type hint improvements (#49320) 2021-04-17 08:35:21 +02:00
Erik Montnemery 2c8b7c56f5
Fix race when restarting script (#49247) 2021-04-16 09:03:34 +02:00
Erik Montnemery ff5fbea1fb
Improve trace of template conditions (#49101)
* Improve trace of template conditions

* Refactor

* Fix wait_template trace

* Update tests
2021-04-12 20:22:28 +02:00
Erik Montnemery 9f481e1642
Include script script_execution in script and automation traces (#48576) 2021-04-01 09:42:23 -07:00
Bram Kragten d1a1e70726
Search for areas used in automations and scripts (#48499)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-03-30 15:01:56 -07:00
Marc Mueller 2956eb0902
Update pylint to 2.7.3 (#48488)
* Update pylint to 2.7.3

* Add class-const-naming-style

* Remove unused-import message

* Additional cleanup
2021-03-29 18:02:56 -10:00
Paulus Schoutsen 63e3012380
Fix script default trace (#48390) 2021-03-26 23:56:40 -07:00
Erik Montnemery 9f8b697e64
Refactor tracing: Prepare for tracing of scripts (#48231) 2021-03-23 14:53:38 -07:00
Franck Nijhof 6932cf9534
Use contextlib.suppress where possible (#48189) 2021-03-23 14:36:43 +01:00
Erik Montnemery 272dffc384
Improve script tracing (#48100)
* Improve script tracing

* Fix test
2021-03-22 13:15:45 +01:00
Marc Mueller 4cb7718192
Update typing 16 (#48087) 2021-03-18 22:58:19 +01:00
Erik Montnemery 7b717bc437
Correct trace for repeat script actions (#48031) 2021-03-18 13:14:06 -07:00
Marc Mueller 6fb2e63e49
Update typing 02 (#48014) 2021-03-17 18:34:19 +01:00
Erik Montnemery 1cde1074c9
Correct trace for choose and repeat script actions (#47973)
* Correct trace for choose and repeat script actions

* only choose-wrap the choices

* Update tests

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-03-16 08:49:16 +01:00
Erik Montnemery f82e59c32a
Make it possible to list debug traces for a specific automation (#47744) 2021-03-15 16:51:04 -07:00
Erik Montnemery a9a9e1f199
Tweak automation tracing (#47721) 2021-03-10 14:42:13 -08:00
Erik Montnemery 704000c049
Add support for breakpoints in scripts (#47632) 2021-03-09 21:23:11 -08:00
Erik Montnemery ea4f3e31d5
Include changed variables in automation trace (#47549)
* Include changed variables in automation trace

* Deduplicate some code

* Tweak

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Fix format

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-03-08 22:48:36 +01:00
Erik Montnemery 2f9d03d115
Merge action and condition traces (#47373)
* Merge action and condition traces

* Update __init__.py

* Add typing to AutomationTrace

* Make trace_get prepare a new trace by default

* Correct typing of trace_cv

* Fix tests
2021-03-06 12:57:21 +01:00
tkdrob 3baeed3684
Clean up constants (#47323) 2021-03-05 19:08:04 +01:00
Erik Montnemery 17401cbc29
Initial automation tracing (#46755)
* Initial prototype of automation tracing

* Small fixes

* Lint

* Move trace helpers to its own file

* Improve trace for state and numeric_state conditions

* Tweaks + apply suggestions from code review

* Index traces by automation_id, trace while script is running

* Refactor condition tracing

* Improve WS API to get traces for single automation

* Add tests

* Fix imports

* Fix imports

* Address review comments

* Cap logging of loops

* Remove unused ContextVar action_config
2021-03-04 14:16:24 +01:00
Anders Melchiorsen d33a1a5ff8
Refine printing of ConditionError (#46838)
* Refine printing of ConditionError

* Improve coverage

* name -> type
2021-02-21 14:54:36 +01:00
Erik Montnemery 2d70806035
Add support for "alias" in script steps device, device_condition, and conditions (#46647)
Co-authored-by: Donnie <donniekarnsinsb@hotmail.com>
2021-02-20 19:21:09 -08:00
J. Nick Koston aa061e5818
Fix variable name from script refactoring (#46503) 2021-02-14 10:52:18 -10:00
Ville Skyttä a6358430b4
Fix deprecated asyncio.wait use with coroutines (#44981)
https://docs.python.org/3/library/asyncio-task.html#asyncio-example-wait-coroutine
2021-02-10 14:16:58 +01:00
Bram Kragten 4b493c5ab9
Add target to service call API (#45898)
* Add target to service call API

* Fix _async_call_service_step

* CONF_SERVICE_ENTITY_ID overrules target

* Move merging up before processing schema

* Restore services.yaml

* Add test
2021-02-10 12:42:28 +01:00
Ville Skyttä 82607977ef
Various type hint improvements (#46144) 2021-02-08 11:59:46 +01:00
Anders Melchiorsen b9b1caf4d7
Raise ConditionError for numeric_state errors (#45923) 2021-02-08 10:47:57 +01:00
Erik Montnemery 8a7e0241ab
Fix race in script wait for trigger step (#46055)
* Fix race in script wait for trigger step

* Update script.py

* Update script.py
2021-02-06 10:01:30 +01:00