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
Mike Degatano
236d274351
Add `search` and `match` as Jinja tests ( #49229 )
2021-04-15 20:13:27 +02:00
J. Nick Koston
82790cd28d
Do not compile static templates ( #49148 )
...
self._compiled_code is unreachable if self.is_static
2021-04-13 16:51:56 +02:00
Franck Nijhof
a610076001
Support min()/max() as template function ( #48996 )
2021-04-12 10:02:04 +02:00
Erik Montnemery
16196e2e16
Don't log template errors from developer tool ( #48933 )
2021-04-09 12:10:02 -07:00
Erik Montnemery
9f5db2ce3f
Improve warnings on undefined template errors ( #48713 )
2021-04-06 12:11:42 -07:00
Paulus Schoutsen
e882460933
Support modern config for the trigger based template entity ( #48635 )
2021-04-02 16:57:16 -07:00
Franck Nijhof
38d14702fa
Remove HomeAssistantType alias from helpers ( #48400 )
2021-03-27 12:55:24 +01:00
Franck Nijhof
6932cf9534
Use contextlib.suppress where possible ( #48189 )
2021-03-23 14:36:43 +01:00
Erik Montnemery
f8755a52c2
Warn on undefined variables in templates ( #48140 )
...
* Warn on undefined variables in templates
* Add test
* fix tests
* fix tests
2021-03-20 15:16:04 +01:00
Franck Nijhof
fb849b81b5
Rewrite of not a == b occurances ( #48132 )
2021-03-20 01:27:04 +01:00
J. Nick Koston
c820dd4cb5
Have pylint warn when user visible log messages do not start with capital letter or end with a period ( #48064 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-19 09:26:36 -05:00
Marc Mueller
6fb2e63e49
Update typing 02 ( #48014 )
2021-03-17 18:34:19 +01:00
Franck Nijhof
5d5a110a20
None optional hass typing in base entity and notify ( #47528 )
2021-03-15 15:11:41 +01:00
Ville Skyttä
dc880118a4
Lint suppression cleanups ( #47248 )
...
* Unused pylint suppression cleanups
* Remove outdated pylint bug references
* Add flake8-noqa config and note to run it every now and then
* Add codes to noqa's
* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
Erik Montnemery
54cf954353
Add device_entities template function/filter ( #46406 )
2021-02-19 21:50:59 -08:00
Franck Nijhof
9b7c39d20b
Postponed evaluation of annotations in core ( #46434 )
...
* Postponed evaluation of annotations in core
* Remove unneeded future
2021-02-12 10:58:20 +01: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
Ville Skyttä
3a88a4120e
Helpers type hint improvements ( #44964 )
2021-01-09 00:08:34 +01:00
Paulus Schoutsen
1de2554f70
Tweak template digit detection ( #43621 )
2020-11-25 16:10:33 +01:00
Paulus Schoutsen
8dbd54bed1
Disable parsing scientific/complex number notation in template type ( #43170 )
2020-11-13 13:22:29 +01:00
Tom Parker-Shemilt
b1ed5a3e79
Fix circular import of config_validation and template ( #41802 )
2020-11-04 19:06:19 -10:00
J. Nick Koston
df552f08c3
Purge unused constants from template helper ( #42618 )
2020-10-30 09:29:12 +01:00
J. Nick Koston
7f1683c731
Remove legacy template extract_entities ( #42601 )
2020-10-30 00:06:08 +01:00
Paulus Schoutsen
e21e28e49f
Fix string representation of template result wrappers ( #42494 )
2020-10-28 09:11:08 +01:00
Paulus Schoutsen
d4efa938dd
Improve mqtt test ( #42490 )
2020-10-27 23:22:59 +01:00
Paulus Schoutsen
711b7d4605
Make result wrappers more robust ( #42488 )
2020-10-27 22:51:58 +01:00
Franck Nijhof
45aba9bdf2
Allow skip parsing template result ( #42401 )
2020-10-26 16:01:09 +01:00
Paulus Schoutsen
bba770b411
Fix CI ( #42397 )
2020-10-26 13:36:03 +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
J. Nick Koston
31c21126a8
Implement time tracking in templates ( #41147 )
...
Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
2020-10-19 11:02:43 +02:00
J. Nick Koston
77b95ae8a1
Reduce domain states rate limit to 1 per second ( #42004 )
2020-10-19 10:18:25 +02:00
J. Nick Koston
21cc23244d
Improve template ratelimit performance ( #41741 )
2020-10-15 12:02:05 +02:00
J. Nick Koston
b897ca7260
Ensure all template errors are caught and the websocket api reports them ( #41719 )
2020-10-12 16:38:24 +02:00
Franck Nijhof
ee914366a8
Add native Python types support to templates ( #41227 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-10-07 00:05:52 +02:00
J. Nick Koston
2fabd4edb8
Prevent collecting states already referenced by domain or all ( #41308 )
...
The template engine would collect all the states in
a domain or all states while iterating even though
they were already included in all or the domain
This lead to the rate limit not being applied to
templates that iterated all states that also
accessed a collectable property because the engine
incorrectly believed they were specifically
referenced.
2020-10-06 07:25:05 +02:00
J. Nick Koston
51da605b9f
Remove manual rate_limit control directive from templates ( #41225 )
...
Increase default rate limit for all states and entire
domain states to one minute
Ensure specifically referenced entities are excluded from
the rate limit
2020-10-04 22:40:04 +02:00
J. Nick Koston
b45215f1d2
Implement template rate_limit directive ( #40667 )
2020-10-01 21:39:44 +02:00
J. Nick Koston
e564af0b5b
Improve performance of accessing template state ( #40323 )
...
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-09-28 10:35:12 -05:00
J. Nick Koston
e08ee282ab
Abort execution of template renders that overwhelm the system ( #40647 )
2020-09-28 14:43:22 +02:00
J. Nick Koston
57b7559832
Ensure all jinja2 errors are trapped and displayed in the developer tools ( #40624 )
...
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-09-26 17:03:32 -05:00
J. Nick Koston
3261a904da
Reduce the number of template re-renders when we are only counting states ( #40272 )
2020-09-26 16:29:49 -05:00
J. Nick Koston
35533407fe
Improve performance of counting and iterating states in templates ( #40250 )
...
Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
2020-09-26 11:36:47 -05:00
Philip Allgaier
ddbcfe83dd
Catch TypeError in strptime() template helper ( #40226 )
2020-09-18 15:29:40 +02:00
J. Nick Koston
ff4bb962c4
Cleanup and reduce duplicate code from recent template changes ( #40012 )
...
As a result of refactoring, there is duplicate code
we can now reduce.
Additionally `_wrap_state` can be removed because
it had unreachable checks for `None`
2020-09-13 09:21:11 -05:00
Jakob Schlyter
9b49ca3820
Add template filter timedelta_seconds to create a timedelta from seconds ( #39608 )
2020-09-11 15:07:31 -05:00
Paulus Schoutsen
aa9dff572e
Add default variables to script helper ( #39895 )
2020-09-10 20:41:42 +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