Commit graph

302 commits

Author SHA1 Message Date
Robert Resch
bb90c1f168
Fix multilevel reference translations (#102338) 2023-10-20 08:12:53 +02:00
Robert Resch
eab4c24f7f
Fix KeyError in derivative and integration (#102294) 2023-10-19 18:22:22 +02:00
Robert Resch
1a7601ebbe
Remove NONE_SENTINEL in favor of optional select in template (#101279) 2023-10-11 13:04:40 +02:00
G Johansson
43954d660b
Add trigger weather template (#100824)
* Add trigger weather template

* Add tests

* mod dataclass

* Remove legacy forecast

* Fix test failure

* sorting

* add hourly test

* Add tests

* Add and fix tests

* Improve tests

---------

Co-authored-by: Erik <erik@montnemery.com>
2023-09-27 10:11:57 +02:00
G Johansson
173b70c850
Fix weather template forecast attributes (#100748) 2023-09-23 13:30:11 +02:00
Erik Montnemery
d1afcd773f
Revert "Cache entity properties that are never expected to change in the base class" (#100422)
Revert "Cache entity properties that are never expected to change in the base class (#95315)"

This reverts commit 042776ebb8.
2023-09-15 11:25:24 +02:00
J. Nick Koston
042776ebb8
Cache entity properties that are never expected to change in the base class (#95315) 2023-09-14 17:48:48 -05:00
Jan Bouwhuis
0d33cba823
Use shorthand attrs in template integration (#100301) 2023-09-13 12:30:43 -05:00
Erik Montnemery
42046a3ce2
Fix TriggerEntity.async_added_to_hass (#100119) 2023-09-11 14:33:43 +02:00
Erik Montnemery
c9a6ea94a7
Send template render errors to template helper preview (#99716) 2023-09-06 16:07:05 +02:00
Erik Montnemery
e1ea53e72f
Correct state attributes in template helper preview (#99722) 2023-09-06 16:06:33 +02:00
Erik Montnemery
c376447ccd
Don't allow changing device class in template binary sensor options (#99720) 2023-09-06 15:59:30 +02:00
Erik Montnemery
cdca4591a4
Include template listener info in template preview (#99669) 2023-09-06 09:49:42 +02:00
Jan-Philipp Benecke
b28fda2433
Move template coordinator to its own file (#99419)
* Move template update coordinator to its own file

* Add coordinator.py to .coveragerc

* Remove coordinator.py to .coveragerc

* Apply suggestions from code review

* Update homeassistant/components/template/coordinator.py

* Copy over fixes from upstream

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2023-09-06 08:54:25 +02:00
G Johansson
47c20495bd
Fix not stripping no device class in template helper binary sensor (#99640)
Strip none template helper binary sensor
2023-09-04 22:46:19 +02:00
Erik Montnemery
7c595ee2da
Validate state in template helper preview (#99455)
* Validate state in template helper preview

* Deduplicate state validation
2023-09-04 14:10:43 +02:00
Allen Porter
7b1c0c2df2
Extend template entities with a script section (#96175)
* Extend template entities with a script section

This allows making a trigger entity that triggers a few times a day,
and allows collecting data from a service resopnse which can be
fed into a template entity.

The current alternatives are to publish and subscribe to events or to
store data in input entities.

* Make variables set in actions accessible to templates

* Format code

---------

Co-authored-by: Erik <erik@montnemery.com>
2023-09-02 16:19:45 -07:00
Erik Montnemery
390c046537
Fix template helper strings (#99456) 2023-09-01 17:14:42 +02:00
Erik Montnemery
f36a300651
Improve template sensor config flow validation (#99373) 2023-08-31 15:16:32 +02:00
Erik Montnemery
501d5db375
Add config flow for template binary sensor (#99339) 2023-08-30 17:28:56 +02:00
Erik Montnemery
63c538b024
Add config flow for template sensor (#98970)
* Add config flow for template sensor

* Tweak error reporting

* Improve validation

* Fix test

* Rename translation strings

* Improve validation

* Fix sensor async_setup_entry

* Avoid duplicating sensor device class translations

* Avoid duplicating sensor device class translations

* Add config flow tests

* Include all units from DEVICE_CLASS_UNITS in unit_of_measurement select

* Address review comments
2023-08-30 16:22:52 +02:00
G Johansson
61c17291fb
Move TemplateEntity to template (#98957)
* Move TemplateEntity to template

* Rename template_entity in helpers
2023-08-24 15:37:04 +02:00
G Johansson
b69e8fda77
Remove TemplateSensor from the template_entity helper (#98945)
Clean off TemplateSensor
2023-08-24 12:14:39 +02:00
Ville Skyttä
b51c0f6ddc
Remove unnnecessary pylint configs from components [s-z]* (#98925) 2023-08-24 01:25:32 +02:00
G Johansson
207e3f90a6
Modernize template weather (#98064)
* Modernize template weather

* mods

* adds templates

* Fixes

* review comments

* more comments

* Fix validator

* Tests

* Mods

* Fix ruff
2023-08-21 15:48:14 +02:00
Ville Skyttä
3094991236
Upgrade ruff to 0.0.285 (#98647) 2023-08-19 08:17:17 -04:00
Franck Nijhof
868a5f377f
Ruff: isort don't split imports based on trailing comma (#98162) 2023-08-10 14:27:03 +02:00
Marc Mueller
582499a260
Improve async_track_template_result callback typing (#97135) 2023-07-24 12:42:17 +02:00
Marc Mueller
77f38e33e5
Import names from typing instead of typing_extensions [3.11] (#97065) 2023-07-22 17:03:44 -05:00
Joost Lekkerkerker
b367c95c81
Add more common translations (#96429)
* Add common translations

* Add common translations

* Add common translations

* Add common translations

* Add common translations

* Add common translations

* Add common translations

* Add common translations
2023-07-12 22:00:05 -04:00
Franck Nijhof
c3871cc5ae
Migrate template services to support translations (#96414) 2023-07-12 14:06:14 +02:00
Erik Montnemery
b8af7fbd55
Update template vacuum supported features (#95831) 2023-07-08 11:47:49 +02:00
Erik Montnemery
68db751ce1
Refactor template image (#95353) 2023-06-27 18:46:36 +02:00
G Johansson
30d22fe49b
Add new attributes into Template Weather (#95100) 2023-06-27 11:19:51 +02:00
Jan Bouwhuis
98cc45ec10
Add image url support (#95301)
* Add image url support

* Use hass as parameter

* Add verify ssl parameter and improve exception handling

* Improve error handling, ignore empty URL's

* Update existing image platforms

---------

Co-authored-by: Erik <erik@montnemery.com>
2023-06-27 08:36:12 +02:00
Erik Montnemery
8e2ba81995
Add image platform to the template integration (#94928)
* Add image platform to the template integration

* Set a default name

* Fix typo

* Add tests

* Improve test coverage

* Derive content-type from fetched image
2023-06-26 15:54:51 +02:00
Erik Montnemery
3e71b1daa4
Correct calls to super class in TriggerEntity (#94916) 2023-06-20 23:00:22 +02:00
G Johansson
1fa82fa886
Move TriggerBaseEntity into helpers (#91945)
* Move TriggerBaseEntity

* mypy
2023-04-25 09:56:40 +02:00
G Johansson
afc9e4303a
Create base TriggerEntity (#91128)
* Trigger entity base class

* mods

* TriggerEntity to CoordinatorTriggerEntity

* variables to variable

* mypy

* unique_id

* Fix

* docstring

* _render_templates

* split manual vs coordinator

* name

* ManualTriggerEntity

* value

* use super

* Remove ManualTriggerEntity

* Use super()
2023-04-17 19:55:54 +02:00
Jan Bouwhuis
722b991234
Support unknown state, position or tilt for template cover (#91172)
* Support unknown state for template cover

* Remove not related changes
2023-04-12 21:23:24 +02:00
Erik Montnemery
7bfc7f134c
Reset state of template cover on error (#88915) 2023-02-28 12:06:40 -05:00
Yann Le Moigne
2314d15761
Fix cover template: optimistic mode is ignored (#87925)
* Fix cover template: optimistic mode is ignored (#84334)

* Fix invalid check in is_closed (make test pass)

* Add test for non optimistic cover

* Update homeassistant/components/template/cover.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update test_cover.py

* Fix format

* Fix tests

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-22 15:54:18 +01:00
Erik Montnemery
b0b1d8143f
Sort manifests 10 (#87031) 2023-02-08 20:41:50 +01:00
Marc Mueller
ea4e2ab4aa
Add Self typing (4) [mypy 1.0] (#87601) 2023-02-06 22:30:22 -06:00
epenet
98198d3c1f
Improve type hints in template (#87172) 2023-02-02 16:26:03 -05:00
Franck Nijhof
5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Franck Nijhof
79b52a2b41
Stricter pylint message control (#86154) 2023-01-20 13:47:55 +01:00
Franck Nijhof
8819634b61
String formatting and max line length - Part 6 (#84525) 2022-12-24 13:19:51 +01:00
epenet
7f1e1ed1d8
Enforce LightEntityFeature (#82460) 2022-11-22 07:14:47 +01:00
epenet
cec81e137c
Enforce AlarmControlPanelEntityFeature (#82313) 2022-11-21 22:58:36 +01:00