epenet
3bbd7daa7f
Improve type hints in template helper ( #136253 )
2025-01-22 15:27:01 +00:00
epenet
b11b36b523
Add more util aliases to import conventions ( #136153 )
2025-01-21 15:58:23 +01:00
Ville Skyttä
40eb8b91cc
Adjust to recommended propcache.api import paths ( #136150 )
2025-01-21 10:58:22 +01:00
Joost Lekkerkerker
ef8b8fbbaa
Enable RUF023 ( #135830 )
2025-01-17 12:28:27 +01:00
Joost Lekkerkerker
b4f4b06f29
Enable RUF021 ( #135832 )
2025-01-17 10:20:45 +01:00
Petro31
566f514a75
Allow is_state_attr to check attributes for None ( #132879 )
2025-01-17 08:41:10 +01:00
Joost Lekkerkerker
8db63adc11
Bump ruff to 0.9.1 ( #135197 )
2025-01-14 11:46:12 +01:00
Marc Mueller
fe0f414e99
Update mypy-dev to 1.14.0a5 ( #132063 )
2024-12-02 14:40:13 +01:00
epenet
c7485b94d5
Use breaks_in_ha_version in report_usage ( #131137 )
...
* Use breaks_in_ha_version in report_usage
* Revert behavior change
2024-11-23 18:58:24 +01:00
epenet
7045b776b6
Use report_usage in helpers ( #130365 )
2024-11-12 09:25:13 +01:00
epenet
f8e6fb81d6
Improve template docstring ( #128967 )
2024-10-22 19:15:27 -10:00
G Johansson
959898e0fc
Fix merge_response template not mutate original object ( #127865 )
...
* Fix merge_response template not mutate original object
* Add comment
2024-10-08 18:35:06 +02:00
J. Nick Koston
db494de809
Restore __slots__ to core objects ( #127441 )
2024-10-03 22:23:47 +02:00
Erik Montnemery
851600630c
Log deprecation warning when template.Template
is created without hass
( #125142 )
...
* Log deprecation warning when template.Template is created without hass
* Improve docstring
2024-09-03 14:28:33 +02:00
Erik Montnemery
df4bd721b5
Deprecate template.attach ( #124843 )
2024-09-02 15:33:10 +02:00
G Johansson
78cf7dc873
New template merge_response ( #114204 )
...
* New template merge_response
* Extending
* Extend comment
* Update
* Fixes
* Fix comments
* Mods
* snapshots
* Fixes from discussion
2024-09-02 08:13:10 +02:00
J. Nick Koston
0a9e20615e
Limit maximum template render output to 256KiB ( #124946 )
...
* Limit maximum template render output to 256KiB
fixes #124931
256KiB is likely to still block the event loop for an unreasonable amont of
time but its likely someone is using the template engine for large
blocks of data so we want a limit which still allows that but has
a reasonable safety to prevent the system from crashing down
* Update homeassistant/helpers/template.py
2024-08-30 22:33:57 +02:00
Petro31
5d64155bb6
Add zip to template engine ( #122460 )
...
* add zip to template engine
* fix doc strings
2024-08-22 19:11:08 +02:00
J. Nick Koston
a8cbfe5159
Make TemplateStateBase.entity_id a cached_property ( #122279 )
2024-07-21 07:49:59 -05:00
Sid
3142f52a79
Add Ruff refurb rules ( #121701 )
2024-07-10 21:47:40 +02:00
Marc Mueller
ca55986057
Import Generator from collections.abc (1) ( #120914 )
2024-07-01 11:51:51 +02:00
Paulus Schoutsen
bc45dcbad3
Add template config_entry_attr function ( #119899 )
...
* Template config_entry_attr function
* Complete test coverage
* Improve readability
2024-06-22 21:51:09 -04:00
Marc Mueller
f0452e9ba0
Update mypy dev 1.11.0a8 ( #120032 )
2024-06-21 13:15:18 +02:00
paulusbrand
624017a0f9
Add template Base64 decode encoding parameter ( #116603 )
...
Co-authored-by: Robert Resch <robert@resch.dev>
2024-06-07 17:01:35 +02:00
Marc Mueller
fe21e2b8ba
Import Generator from typing_extensions (1) ( #118986 )
2024-06-06 17:02:13 +02:00
J. Nick Koston
607aaa0efe
Speed up template result parsing ( #118168 )
2024-05-26 13:09:12 +02:00
J. Nick Koston
42232ecc8a
Remove unused code in template helper ( #118075 )
2024-05-24 17:44:24 -10:00
J. Nick Koston
6923fb1601
Avoid template context manager overhead when template is already compiled ( #118079 )
2024-05-24 17:44:02 -10:00
J. Nick Koston
5cb3bc19c0
Speed up async_render_with_possible_json_value ( #118080 )
2024-05-24 17:43:42 -10:00
J. Nick Koston
f026083712
Speed up is_template_string by avoiding regex engine ( #118076 )
2024-05-24 17:42:55 -10:00
Marc Mueller
905adb2431
Update codespell ignore list ( #118018 )
2024-05-24 10:24:34 +02:00
J. Nick Koston
c9d1b127d8
Improve error message when template is rendered from wrong thread ( #117822 )
...
* Improve error message when template is rendered from wrong thread
* Improve error message when template is rendered from wrong thread
2024-05-20 23:26:48 -04:00
Marc Mueller
900b6211ef
Use PEP 695 for function annotations (2) ( #117659 )
2024-05-18 11:44:39 +02:00
Troon
cc99a9b62a
Add an add template filter ( #109884 )
...
* Addition of add filter
This change adds an `add` filter, the addition equivalent of the existing `multiply` filter.
* Test for add filter
* Update test_template.py
* Update tests/helpers/test_template.py
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-08 15:39:36 +02:00
Marc Mueller
8f614fb06d
Use HassKey for helpers (2) ( #117013 )
2024-05-07 11:24:13 -05:00
Sid
2cc916db6d
Replace pylint broad-except with Ruff BLE001 ( #116250 )
2024-05-07 14:00:27 +02:00
Sid
b456d97e65
Replace pylint protected-access with Ruff SLF001 ( #115735 )
2024-05-06 20:33:26 +02:00
Erik Montnemery
6bff0c384f
Remove deprecation warnings for relative_time ( #116144 )
...
* Remove deprecation warnings for relative_time
* Update homeassistant/helpers/template.py
Co-authored-by: Simon <80467011+sorgfresser@users.noreply.github.com>
---------
Co-authored-by: Simon <80467011+sorgfresser@users.noreply.github.com>
2024-04-25 13:02:18 +02:00
Erik Montnemery
2e88ba40ff
Fix lying docstring for relative_time template function ( #116146 )
...
* Fix lying docstring for relative_time template function
* Update homeassistant/helpers/template.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-25 13:01:41 +02:00
rlippmann
1120246194
Deprecate relative_time() in favor of time_since() and time_until() ( #111177 )
...
* add time_since/time_until. add deprecation of relative_time
* fix merge conflicts
* Apply suggestions from code review
* Update homeassistant/helpers/template.py
* Update homeassistant/helpers/template.py
* Update homeassistant/helpers/template.py
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-04-24 11:13:07 +02:00
J. Nick Koston
53a179088f
Add debug mode to catch unsafe thread operations using core helpers ( #115390 )
...
* adjust
* adjust
* fixes
* one more
* test
* debug
* move to config
* cover
* Update homeassistant/core.py
* set debug from RuntimeConfig
* reduce
* fix message
* raise
* Update homeassistant/core.py
* Update homeassistant/core.py
* no flood check for raise
* cover
2024-04-24 03:36:05 +02:00
Martijn van der Pol
e90d76b18d
Don't raise errors when using datetime objects in as_datetime
Jinja function/filter ( #109062 )
...
* add support for datetime objects to as_datetime
* change import of datetime.date
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-04-23 09:55:58 +02:00
Sid
895f73d8e4
Enable Ruff A001 ( #115654 )
2024-04-21 23:25:27 +02:00
J. Nick Koston
11931cdb56
Simplify labels and areas template calls ( #115673 )
...
The labels and areas are already exposed on the object
2024-04-17 21:28:09 +02:00
Sid
d61db732da
Enable Ruff SLOT rules ( #115043 )
2024-04-09 18:57:27 -10:00
J. Nick Koston
ca5ed274cb
Deprecate calling async_listen and async_listen_once with run_immediately ( #115169 )
2024-04-08 10:07:54 -10:00
Sid
8e98ba7312
Add first batch of Ruff PYI rules ( #115100 )
...
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-04-07 11:30:50 -10:00
Robert Resch
7adced6876
Allow passing area/device/entity IDs to floor_id and floor_name ( #114748 )
2024-04-03 16:33:58 +02:00
Sid
f7b7f74d10
Enable Ruff TRY201 ( #114269 )
...
* Enable Ruff TRY201
* remove redundant rules
2024-03-28 10:18:07 +01:00
Franck Nijhof
5c69e0d2c6
Add label template functions ( #111024 )
2024-03-26 10:32:29 +01:00