Commit Graph

177 Commits (1ad9f1d71426bd33990c585ad973bee584fb4413)

Author SHA1 Message Date
Marc Mueller f1d48ddfe3
Update pylint to 2.8.0 (#49637) 2021-04-24 14:39:24 -10: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
Ville Skyttä 970cbcbe15
Type hint improvements (#49320) 2021-04-17 08:35:21 +02:00
Erik Montnemery d1df6e6fba
Don't get code_context when calling inspect.stack (#48849)
* Don't get code_context when calling inspect.stack

* Update homeassistant/helpers/config_validation.py
2021-04-09 07:26:09 +02:00
Franck Nijhof 4e3c12883e
Allow templatable service target to support scripts (#48600) 2021-04-01 13:10:01 -07:00
Marc Mueller 6fb2e63e49
Update typing 02 (#48014) 2021-03-17 18:34:19 +01:00
Alan Tse f86e7535e0
Add location details to deprecation warning (#47155) 2021-03-16 21:16:07 +01:00
Franck Nijhof 42fd3be0e8
Add template support to service targets (#46977)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-02-23 22:46:00 -08: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
tkdrob c2302784c2
Use core constants for helpers (#46240) 2021-02-08 22:53:17 +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
Philip Allgaier 84f506efb7
Set default position value for cover action (#45670)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-01-29 21:11:12 +01:00
Joakim Sørensen b1c2cde40b
Changes to filename and path validation (#45529)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-01-26 15:53:21 +01:00
Alexei Chetroi de8f273bd0
Allow input_number entity_id as for numeric_state trigger thresholds (#45091)
* Allow input_number as limits for numeric_state trigger

* Rename threshold schema
2021-01-13 16:20:59 +01:00
Ville Skyttä 3a88a4120e
Helpers type hint improvements (#44964) 2021-01-09 00:08:34 +01:00
Paulus Schoutsen 594e905742
Remove invalidation_version from deprecated (#44156)
* Remove invalidation_version from deprecated. We don't follow up and just hurts releases

* Revert change to ZHA
2020-12-12 22:24:16 +01:00
Paulus Schoutsen 0de9e8e952
Allow specifying device_id as target (#43767) 2020-11-30 14:27:02 +01:00
Paulus Schoutsen dd513147a5
Add a service target (#43725) 2020-11-28 23:33:32 +01:00
Paulus Schoutsen 0a717f313e
Improve entity domain validator (#43164) 2020-11-13 13:31:43 +01:00
Paulus Schoutsen aec191b558
Support datetime sensor in time trigger (#42899) 2020-11-09 14:50:54 +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
springstan a967f689c7
Remove unnecessary instances of dict.keys() (#42518) 2020-10-28 20:43:48 +01:00
Paulus Schoutsen e552c9ba96
Store original result on template results (#42391)
* Store original result on template results

* Fix shell command test
2020-10-26 11:30:58 +01:00
Ville Skyttä f28c3273c2
Upgrade mypy to 0.790 (#41595) 2020-10-12 19:17:30 -05:00
Matthias Alphart 93a9a11065
Add config validator helper positive_float (#41640) 2020-10-11 22:04:49 +02:00
Raman Gupta d3734aae9d
Allow custom_serializer to recognize cv.string and cv.boolean to make config schema more reusable (#41532) 2020-10-09 09:36:54 +02:00
Paulus Schoutsen fe2c16dc29
Allow any value when triggering on state attribute (#41261) 2020-10-05 12:53:12 +02:00
springstan a2c3c33b22
Use core GitHub URL in all files (#41089) 2020-10-03 00:04:11 +02:00
Thomas Lovén f59e727f16
Set variable values in scripts (#39915)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-09-11 13:16:25 +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 878347243d
Numeric state condition can also accept input_number entity ID (#39680) 2020-09-06 20:04:07 +02:00
Franck Nijhof a3c45a6f89
Add shorthand notation for Template conditions (#39705) 2020-09-06 16:55:06 +02:00
Franck Nijhof da9b077c11
Time condition can also accept an input_datetime Entity ID (#39676) 2020-09-06 16:06:09 +02:00
Ville Skyttä b4bac0f7a0
Exception chaining and wrapping improvements (#39320)
* Remove unnecessary exception re-wraps

* Preserve exception chains on re-raise

We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.

The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.

Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.

* Fix mistaken re-wrap in homematicip_cloud/hap.py

Missed the difference between HmipConnectionError and
HmipcConnectionError.

* Do not hide original error on plex new cert validation error

Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
2020-08-28 13:50:32 +02:00
Franck Nijhof 181709f3d2
Allow templates in data & service parameters (making data_template & service_template obsolete) (#39210) 2020-08-24 16:21:48 +02:00
Bas Nijholt a9ffc149f8
Allow templating keys in data_template (#39008)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-08-21 22:42:05 +02:00
Phil Bruckner 76ead858cf
Add wait_for_trigger script action (#38075)
* Add wait_for_trigger script action

* Add tests

* Change script integration to use config validator
2020-08-21 11:38:25 +02:00
J. Nick Koston 1381b279f0
Update template sensor to use async_track_template_result (#38940)
* Add template entity

* Update template tracking to work for template sensors

* add test for whitespace

* Update homeassistant/helpers/config_validation.py

* revert

* fix

* reduce

* fix _refresh missing decorator

* defer until start

* do not throw errors during startup

* defer tracking until start event

Co-authored-by: Swamp-Ig <github@ninjateaparty.com>
2020-08-20 08:06:41 -05:00
Franck Nijhof bdc5af8dd2
Add support for attributes in (numeric) state conditions (#39050) 2020-08-19 20:01:27 +02:00
Phil Bruckner ca9dd0c833
Reorganize trigger code (#38655) 2020-08-17 11:54:56 -05:00
Phil Bruckner 580e229cf2
Create variable with result of wait_template and accept template for timeout option (#38634) 2020-08-12 13:42:06 -05:00
Phil Bruckner 726d5fdd94
Allow float values in time periods (#38023) 2020-07-21 19:41:42 -05: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
Phil Bruckner 91271f388c
Add new repeat loop for scripts and automations (#37589) 2020-07-10 13:37:19 -05: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
Ville Skyttä 29b8f76e57
Use past tense in messages for already invalidated deprecated configs (#36591) 2020-06-09 23:26:55 -07:00
Franck Nijhof e86bedb223
Prevent possible secret values to show up in deprecation logs (#36368)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-02 17:29:59 +02:00
Bram Kragten cb7b8d94c0
Add check for HTML in translations (#35615)
* Add check for HTML in translations

and remove existing html

* Add test
2020-05-14 19:33:14 +02:00