Commit Graph

161 Commits (af737f2be836af5e405b880695ab630f3b85023c)

Author SHA1 Message Date
Erik Montnemery 46f27fdefd
Don't prevent automations from triggering themselves (#68178) 2022-03-15 18:48:54 +01:00
Erik Montnemery 8ea31cea3a
Fix deadlock when stopping queued script (#68175) 2022-03-15 08:29:04 -07:00
Erik Montnemery 1a27025793
Prevent spawning script runs when shutting down (#68170) 2022-03-15 12:46:58 +01:00
Erik Montnemery 65fbcfa0ba
Prevent recursive script calls from deadlocking (#67861)
* Prevent recursive script calls from deadlocking

* Address review comments, improve tests

* Tweak comment
2022-03-10 19:28:00 +01:00
Paulus Schoutsen c2e62e4d9f
Re-org device automations (#67064)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-02-22 13:15:16 -08:00
mk-maddin efb6fd1569
Fix script / automation repeat with count 0 fails (#65448)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-02-03 08:18:58 -08:00
Marc Mueller d3b7bd25ef
Update typing (1) (#63922) 2022-01-11 21:26:03 +01:00
Marc Mueller 40262c4763
Fix exception import locations (#63454) 2022-01-05 15:00:49 +01:00
Tobias Sauerwein 2c904c0974
Bump mypy to 0.930 (#62642)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2021-12-27 17:55:17 +01:00
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