Commit Graph

576 Commits

Author SHA1 Message Date
Ville Skyttä
5e90a4d000 Use more state attribute name constants (#40428) 2020-09-21 23:03:39 +02:00
J. Nick Koston
e9abb357e4 Log template listeners when debug logging is on (#40180) 2020-09-17 14:45:30 -05:00
Franck Nijhof
cd26384634 Fix entity extraction from Template conditions (#40034) 2020-09-13 22:05:45 +02:00
Jakob Schlyter
9b49ca3820 Add template filter timedelta_seconds to create a timedelta from seconds (#39608) 2020-09-11 15:07:31 -05:00
J. Nick Koston
741487a1fc Return the listeners with the template result for the websocket api (#39925) 2020-09-11 13:18:40 -05: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
J. Nick Koston
e208aac834 Add async_track_state_removed_domain to allow tracking when a state is removed from a domain (#39859)
when a state is removed from a domain
2020-09-11 13:03:31 +02:00
Franck Nijhof
101b5b3b35 Accept known hosts for get_url for OAuth (#39936) 2020-09-11 13:00:00 +02:00
Paulus Schoutsen
5117a16841 Extract variable rendering (#39934) 2020-09-11 12:24:16 +02:00
J. Nick Koston
fb31b04c08 Increase template test coverage. (#39908) 2020-09-10 20:43:45 +02:00
Joakim Sørensen
0cce35b23e Add exception for NoURLAvailableError in OAuth2FlowHandler (#39845)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-09-10 14:52:49 +02:00
Aidan Timson
6f43285a28 Force token expires_in to float (#39489) 2020-09-07 21:26:58 +02:00
J. Nick Koston
5e83feeabf Increase test coverage for template sandbox (#39750) 2020-09-07 17:33:22 +02:00
J. Nick Koston
90d574e521 Ensure static templates are still called back on first refresh (#39753) 2020-09-07 17:19:39 +02:00
Erik Montnemery
863b63d75e Fix handling of device registry defaults (#39688) 2020-09-06 21:08:50 -05:00
Franck Nijhof
1ec3446c56 State condition can also accept an input_* Entity ID as state value (#39691) 2020-09-07 00:36:01 +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
springstan
d2b1918e9c Drop UNIT_ prefix for percentage constant (#39383) 2020-09-05 21:09:14 +02:00
J. Nick Koston
a096c20930 Fix missing assert in template test (#39648) 2020-09-04 16:28:56 +02:00
J. Nick Koston
35e84d0427 Add as_local convenience function to jinja templates (#39618) 2020-09-03 14:35:16 -05:00
J. Nick Koston
a778690b64 Support reloading the group notify platform (#39511) 2020-09-03 00:12:07 +02:00
Phil Bruckner
4486251382 Add max_exceeded log level option to automations & scripts (#39448) 2020-09-02 11:05:14 +02:00
J. Nick Koston
e55a014e94 Undecorate RenderInfo result property (#39108) 2020-09-02 10:35:15 +02:00
J. Nick Koston
a77e09b2c2 Make async_track_template_result track multiple templates (#39371)
* Make async_track_template_result track multiple templates

Combine template entity updates to only write ha
state once per template group update

* Make async_track_template_result use dataclasses for input/output

* black versions

* naming
2020-08-31 19:07:40 -05:00
Paulus Schoutsen
190611a079 Detect comments in jinja templates (#39496) 2020-08-31 10:51:30 +02:00
J. Nick Koston
8b893173fd Prevent CoordinatorEntity from requesting updates on disabled entities (#39452) 2020-08-30 12:10:22 -05:00
J. Nick Koston
f8712b0e00 Create a CoordinatorEntity class to avoid repating code in integrations (#39388) 2020-08-30 12:02:37 +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
J. Nick Koston
414a59ae9f Add the ability to reload homekit from yaml (#39326) 2020-08-28 16:46:45 +02:00
Franck Nijhof
1c2ebdf307 Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
J. Nick Koston
810df38f0d Add the ability to reload light/cover groups from yaml (#39250)
* Add the ability to reload light/cover groups from yaml

Update previous usage to reduce code duplication.

* Fix conflict from rebase
2020-08-25 18:13:43 -05:00
J. Nick Koston
c87e03ee6f Ensure template tracking can recover after the template generates an exception (#39256) 2020-08-26 00:33:08 +02:00
J. Nick Koston
90842fcb84 Support reloading the universal platform (#39248) 2020-08-26 00:25:15 +02:00
J. Nick Koston
20398cc0a6 Subscribe to state change events only if the template has entities (#39188) 2020-08-26 00:20:04 +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
J. Nick Koston
c3ad493bb7 Report usage of extract_entities by custom components (#39185)
Block core usage usage of extract_entities

Suggest event.async_track_template_result instead.
2020-08-23 19:38:45 +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
Paulus Schoutsen
05d54a60b0 Deprecate optional script context (#39034)
Co-authored-by: Phil Bruckner <pnbruckner@gmail.com>
2020-08-21 14:17:47 +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
Paulus Schoutsen
3dc79aa60a Track entity sources (#37258)
Co-authored-by: David Mulcahey <david.mulcahey@me.com>
2020-08-19 14:57:38 +02:00
Phil Bruckner
ca9dd0c833 Reorganize trigger code (#38655) 2020-08-17 11:54:56 -05:00
J. Nick Koston
472b12bef5 Update TrackTemplateResultInfo to remove side effects from init (#38934)
* Verify and case

* Review comments

* Update homeassistant/helpers/event.py

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

* Update homeassistant/helpers/event.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-08-16 11:16:28 -05:00
J. Nick Koston
7d0e356560 Add track_template_result method to events (#38802)
* Merge original changes from #23590

* guard

* adjust

* adjust

* adjust

* Update async_render_to_info for recent codebase changes

* no more protected access

* do not fire right away per review comments

* update test to not fire right away

* closer

* rework tests for non firing first

* augment coverage

* remove cruft

* test for complex listen add/remove

* update docs to match review feedback to not fire right away

* preserve existing behavior

* fix test

* Ensure listeners are cleaned up

* de-dupe and comment

* de-dupe and comment

* coverage

* test to login again if we go from exception to ok to exception

* Update homeassistant/core.py

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

* Update homeassistant/helpers/event.py

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

* rename _boolean_coerce to result_as_boolean and move it out of event

* additional coverage

* Add more tests (may still be able to trim this down)

Co-authored-by: Swamp-Ig <github@ninjateaparty.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-08-15 19:53:03 -05:00
Franck Nijhof
755761867d Use current request context in OAuth redirect (#38692) 2020-08-15 15:26:54 +02:00
Paulus Schoutsen
b3571602bb Add default_* to device registry (#38829) 2020-08-13 10:38:56 +02:00
Joakim Plate
15db2225da async_get_instance was not reentrant during await (#38263) 2020-08-12 22:35:24 +02:00