Commit Graph
61 Commits
Author SHA1 Message Date
Petro31 3e0aab55a8 Fix delay_on and delay_off restarting when a new trigger occurs during the delay (#145050) 2025-06-11 14:08:10 +01:00
Erik Montnemery f83c8de8d3 Update signature of platforms' async_setup_entry (#138201) 2025-02-10 21:08:03 +01:00
epenet d5568ff955 Standardize homeassistant imports in full-CI components (#136731)
Standardize homeassistant imports in components
2025-01-28 13:11:19 -05:00
epenet b28fa2a1ad Use shorthand attribute in template binary sensor (#128966) 2024-10-24 16:16:46 +02:00
Erik Montnemery dc462aa529 Remove unnecessary assignment of Template.hass from template (#123773) 2024-08-13 11:54:36 +02:00
dougiteixeira 0d48d5a5ec Remove device ID from config schema via YAML in helper template (#120708) 2024-07-07 16:40:02 +02:00
epenet 399130bc95 Force alias when importing binary sensor PLATFORM_SCHEMA (#120510) 2024-06-26 10:54:19 +02:00
dougiteixeira 6e32a96ff3 Add the ability to bind the template helper entity to a device (#117753) 2024-06-22 12:45:06 +02:00
Marc Mueller dd22ee3dac Improve annotation styling (#118032) 2024-05-24 15:05:53 +02:00
Marc Mueller 062cc4bfce Add empty line after module docstring [t-v] (#112705) 2024-03-08 10:35:23 -05:00
Jan Bouwhuis 0d33cba823 Use shorthand attrs in template integration (#100301) 2023-09-13 12:30:43 -05: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
Marc Mueller 77f38e33e5 Import names from typing instead of typing_extensions [3.11] (#97065) 2023-07-22 17:03:44 -05: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
epenet 9211ba8371 Improve type hints in template (#74294) 2022-07-01 10:05:37 -07:00
Erik Montnemery 146ff83a16 Migrate rest binary_sensor and switch to TemplateEntity (#73307) 2022-06-28 13:53:38 -07:00
Erik Montnemery 5987266e56 Refactor template entity to allow reuse (#72753)
* Refactor template entity to allow reuse

* Fix schema and default name

* Add tests

* Update requirements

* Improve test

* Tweak TemplateSensor initializer

* Drop attributes and availability from TemplateEntity

* Use rest sensor for proof of concept

* Revert changes in SNMP sensor

* Don't set _attr_should_poll in mixin class

* Update requirements
2022-06-08 15:55:49 +02:00
Erik Montnemery 7b5dd4a623 Restore attributes of template binary sensor (#69350) 2022-04-05 22:58:12 -07:00
Erik Montnemery 7fc0ffd5c5 Restore state of trigger based template binary sensor (#67538) 2022-03-14 12:28:55 -07:00
Erik Montnemery 2007379701 Restore state of template binary sensor with on or off delay (#67546) 2022-03-03 15:27:39 -08:00
epenet 47d6f75c17 Enable basic type checking in template (#66222)
* Fix binary_sensor

* Adjust button

* Adjust fan

* Adjust select

* Adjust template_entity

* Adjust trigger_entity

* Adjust weather

* Adjust init

* Adjust number

* Adjust None check
2022-02-10 10:59:54 +01:00
Erik Montnemery e9a9b119c4 Teach TemplateEntity unique_id (#64837) 2022-01-24 23:16:31 +01:00
Erik Montnemery 321f54494e Teach TemplateEntity entity name (#62175)
* Teach TemplateEntity entity name

* Remove default name from number and select config schemas

* Re-add default name to number and select config schemas

* Set name to None if name template fails to render

* Update template button
2022-01-24 15:44:05 +01:00
epenetandepenet 862daff622 Add binary_sensor setup type hints [s-z] (#63271)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-03 13:13:03 +01:00
Amos Yuen 45ab9a3e33 Init template trigger binary sensor to None instead of False (#62769) 2021-12-27 20:52:26 +01:00
Michael 90e52cd3ad Use relative imports [S-Z] (#61576) 2021-12-13 09:39:13 +01:00
Erik Montnemery a67a4873dc Minor refactor of template cover (#59537) 2021-12-02 10:26:10 -08:00
Erik Montnemery e20127d9ff Minor refactor of template binary sensor (#59432)
* Minor refactor of template binary sensor

* pylint

* Tweak
2021-11-10 07:58:22 +01:00
Raman Gupta 8407ad01d4 Add select platform to template integration (#54835) 2021-08-25 11:21:24 -07:00
Paulus Schoutsen f5e4b13814 Add auto_off to binary sensor template entity (#49615) 2021-04-29 09:25:34 -07:00
Paulus Schoutsen dcee78b747 Template sensor/binary sensors without trigger now respect section unique id (#49613) 2021-04-24 07:14:31 -07:00
Paulus SchoutsenandMartin Hjelmare 1016d4ea28 Support trigger-based template binary sensors (#49504)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-22 14:54:28 -07:00
Paulus Schoutsen beea2dd35f Internally work with modern config syntax for template binary sensor platform config (#48981) 2021-04-13 07:58:44 -07:00
Paulus Schoutsen 3dec394cad Migrate template to register reload service on async_setup (#48273) 2021-03-23 20:35:15 -07:00
tkdrob 2c3a2bd35e Clean up template (#46509) 2021-02-14 12:16:30 +01:00
Maciej Wilczyński 6a5546afc1 Add an option to template delay_on/off in template binary sensor (#43259) 2020-11-17 07:24:04 -10:00
Philip Allgaier dde6305549 Cleanup unused loggers (components N-Z + tests) (#41982) 2020-10-16 21:24:08 -05:00
J. Nick Koston 4bbd69955b Restore missing device_class to template binary_sensor (#39805) 2020-09-08 17:12:23 +02:00
J. Nick Koston 762537d82d Deprecate manually passing entity ids to template entities (#39382)
It is no longer necessary to provide a list of entities to monitor
to the template platforms.

The template is now re-evaluated whenever
a referenced entity changes state, and new entities are automaticlly
discovered.

Automatic analysis can now determine the entities for all templates
without the need for manual setup.
2020-09-01 08:53:50 -05: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 90842fcb84 Support reloading the universal platform (#39248) 2020-08-26 00:25:15 +02:00
J. Nick Koston 83b9c6188d Make template entities reloadable (#39075)
* Make template entities reloadable

* Address review items
2020-08-21 18:31:48 -05:00
J. Nick Koston 796d74886e Simplify template integration entities (#39083) 2020-08-21 14:33:53 +02:00
J. Nick KostonandPenny Wood 5a8013b58c Convert template binary_sensor to use async_track_template_result (#39027)
Co-Authored-By: Penny Wood <Swamp-Ig@users.noreply.github.com>

Co-authored-by: Penny Wood <Swamp-Ig@users.noreply.github.com>
2020-08-20 09:07:58 -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
Michaël Arnauts f09a9abc1c Add optional unique_id attribute to the template platforms (#38011)
* Add unique_id to template platforms

* Update test_binary_sensor.py

* Update test_binary_sensor.py
2020-08-01 12:45:55 -10:00
J. Nick Koston 44fefb3216 Improve handling of template platforms when entity extraction fails (#37831)
Most of the the template platforms would check for
extract_entities failing to extract entities and avoid
setting up a state change listner for MATCH_ALL after
extract_entities had warned that it could not extract
the entities and updates would need to be done manually.
This protection has been extended to all template platforms.

Alter the behavior of extract_entities to return the
successfully extracted entities if one or more templates
fail extraction instead of returning MATCH_ALL
2020-07-14 22:34:35 -07:00
Franck Nijhof 53545c984b Log lines do not end with a full stop (#37527) 2020-07-05 23:04:19 +02:00