J. Nick Koston
3a06659120
Speed up single entity/response service calls ( #96729 )
...
* Significantly speed up single entity/response service calls
Since the majority of service calls are single entity, we can
avoid creating tasks in this case. Since the multi-entity
service calls always check the result and raise, we can switch
the asyncio.wait to asyncio.gather
* Significantly speed up single entity/response service calls
Since the majority of service calls are single entity, we can
avoid creating tasks in this case. Since the multi-entity
service calls always check the result and raise, we can switch
the asyncio.wait to asyncio.gather
* revert
* cannot be inside pytest.raises
* one more
* Update homeassistant/helpers/service.py
2023-07-17 09:33:13 +02:00
Erik Montnemery
17ac1a6d32
Set automations which fail validation unavailable ( #94856 )
2023-06-27 18:23:33 +02:00
Jan Bouwhuis
ec98e22330
Add type hints for stub_blueprint_populate fixture ( #93568 )
...
Add typehints for stub_blueprint_populate fixture
2023-05-26 08:13:13 +02:00
Erik Montnemery
3cca338c6e
Improve blueprint test fixtures ( #93519 )
2023-05-25 13:45:19 +02:00
epenet
a102883eff
Add type hints to integration tests (part 2) ( #88493 )
2023-02-21 09:25:05 +01:00
Jan Bouwhuis
ebb450c946
Default `hass_config` to contain an empty config ( #88515 )
...
* Default hass_config to {}
* Correct type hint
2023-02-21 08:48:44 +01:00
Erik Montnemery
cc4a179ca8
Support templating for in state conditions ( #88411 )
2023-02-20 18:57:00 +01:00
Jan Bouwhuis
4f6a25b470
Allow parameterizing YAML config in tests ( #87981 )
...
* Add fixture to parameterize yaml config
* Apply to more tests
* Re-add @fixture label
* Add fixtures to patch yaml content and targets
* Typo
* Improve docstr
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Update references to mock_yaml_configuration
* Apply new fixtures
* Apply to check_config tests
* Follow up comments
* Rename fixtures, update docstr
* Split paths
* Patch load_yaml_config_file instead
* sort
* Fix tests
* improve docst
* Rename fixtures
* sorting
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Improve docstr
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Improve docstr
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Improve docstr
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Improve docstr
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Improve docstr
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Improve docstr
Co-authored-by: Erik Montnemery <erik@montnemery.com>
---------
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-20 16:57:12 +01:00
Franck Nijhof
ed79265843
Enable Ruff PT006 ( #88165 )
...
* Enable Ruff PT006
* Adjust existing cases
* Fix tests
* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet
fe747601ff
Cleanup DeviceClass and StateClass in tests ( #78811 )
2022-09-20 10:49:11 -04:00
Thomas Lovén
7cc799becf
Fix setup failure tests failing for the wrong reason ( #70144 )
2022-04-16 11:59:38 +02:00
Franck Nijhof
fb92fc6a8e
Trigger on not matching to/from states ( #69760 )
2022-04-12 14:18:23 -07:00
Erik Montnemery
36734972f0
Teach numeric state trigger about entity registry ids ( #60835 )
2021-12-02 09:45:40 -08:00
Erik Montnemery
c85bb27d0d
Teach state trigger about entity registry ids ( #60271 )
...
* Teach state trigger about entity registry ids
* Tweak
* Add tests
* Tweak tests
* Fix tests
* Resolve entity ids during config validation
* Update device_triggers
* Fix mistake
* Tweak trigger validator to ensure we don't modify the original config
* Add index from entry id to entry
* Update scaffold
* Pre-compile UUID regex
* Address review comment
* Tweak mock_registry
* Tweak
* Apply suggestion from code review
2021-12-02 14:26:45 +01:00
Erik Montnemery
4f01631bd6
Allow triggering on all state changes, ignoring attributes ( #59713 )
...
* Allow triggering on all state changes, ignoring attributes
* Add comment
* Apply suggestions from code review
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-11-16 08:35:52 +01:00
Erik Montnemery
8d910c5079
Revert "Add offset support to time trigger" ( #58947 )
2021-11-02 16:56:38 +01:00
Robert Meijers
c9966a3b04
Add offset support to time trigger ( #56838 )
2021-10-26 15:52:43 +02:00
Franck Nijhof
05241a7a68
Allow number/sensor entities in numeric state conditions/triggers ( #51439 )
2021-06-04 18:14:48 +02:00
Erik Montnemery
b26779a27a
Add id to automation triggers ( #48464 )
2021-03-31 14:56:04 +02:00
Franck Nijhof
5a2b5fe7c5
Yoda assertion style removed is ( #48142 )
2021-03-20 13:55:10 +01:00
Franck Nijhof
7a8b7224c8
Don't raise on known non-matching states in numeric state condition ( #47378 )
2021-03-04 13:09:08 -08: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
Anders Melchiorsen
26ce316c18
Do not trigger when numeric_state is true at startup ( #46424 )
2021-02-20 09:11:36 +01:00
Anders Melchiorsen
48002f47f4
Use caplog fixture for log capturing ( #46214 )
2021-02-08 14:33:57 +01:00
Erik Montnemery
0780e52ca4
Support templates in event triggers ( #46207 )
...
* Support templates in event triggers
* Don't validate trigger schemas twice
2021-02-08 14:06:27 +01:00
Erik Montnemery
2744d64a3e
Pass variables to state trigger templates ( #46208 )
...
* Pass variables to state trigger templates
* Remove non working test
2021-02-08 13:22:01 +01:00
Erik Montnemery
9d9c4b47ee
Pass variables to numeric state trigger templates ( #46209 )
2021-02-08 13:21:31 +01:00
Anders Melchiorsen
b9b1caf4d7
Raise ConditionError for numeric_state errors ( #45923 )
2021-02-08 10:47:57 +01:00
Alexei Chetroi
de8f273bd0
Allow input_number entity_id as for numeric_state trigger thresholds ( #45091 )
...
* Allow input_number as limits for numeric_state trigger
* Rename threshold schema
2021-01-13 16:20:59 +01:00
Franck Nijhof
65cf2fcb6f
Drop asynctest ( #44746 )
2021-01-01 22:31:56 +01:00
Anders Melchiorsen
ce3f6c368a
Initialize numeric_state trigger tests ( #44114 )
...
This makes the crossed thresholds explicit.
2020-12-11 05:11:51 +01:00
Paulus Schoutsen
b3be708db6
Add default config if not there ( #43321 )
...
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-11-25 15:10:04 +01:00
Paulus Schoutsen
bbb82ded68
Fix time trigger based on entities ignoring entities if initially in the past ( #43431 )
2020-11-20 15:43:28 +01:00
Anders Melchiorsen
390b45b149
Reword numeric_state trigger ( #43367 )
2020-11-19 12:00:01 +01:00
Franck Nijhof
6f326a7ea4
Add support for multiple event triggers in automation ( #43097 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-11-12 11:58:28 +01:00
Paulus Schoutsen
aec191b558
Support datetime sensor in time trigger ( #42899 )
2020-11-09 14:50:54 +01:00
Paulus Schoutsen
7027b01a29
Fix broken time trigger test ( #42606 )
2020-10-29 22:34:06 +01:00
Paulus Schoutsen
388a5d8c91
Add entity ID to time trigger ( #41933 )
2020-10-19 09:42:00 +02:00
On Freund
b5e57ed4fd
Support matching multiple user ids in event trigger ( #41036 )
2020-10-08 09:10:42 +02:00
Paulus Schoutsen
fe2c16dc29
Allow any value when triggering on state attribute ( #41261 )
2020-10-05 12:53:12 +02:00
On Freund
04f87eedf5
Add context to event trigger ( #40932 )
2020-10-01 11:59:35 +02:00
Franck Nijhof
8837ed35cd
Use direct service calls in tests instead of automation common ( #40623 )
...
* Use direct service calls in tests instead of automation common
* Remove automation common test helpers
2020-09-26 19:28:26 +02:00
Kevin Cathcart
371b589cb2
Fix bug in state trigger when using for: without to: ( #40556 )
2020-09-25 09:15:04 +02:00
Anders Melchiorsen
7876cdb37a
Fix handling of quoted time_pattern values ( #40470 )
...
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2020-09-23 09:21:57 +02:00
Bas Nijholt
c2a9a39ee0
Don't trigger on attribute when the attribute doesn't change ( #39910 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-09-11 14:02:17 +02:00
Paulus Schoutsen
bb661ad083
Fix event trigger ( #39884 )
...
Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-09-10 11:25:56 +02:00
Franck Nijhof
7c86fa0203
Support 'for' without setting the 'to'-state in automation state triggers ( #39730 )
2020-09-07 16:30:02 +02:00
Anders Melchiorsen
4b84b74b89
Support state trigger with from/for but no to ( #39480 )
2020-09-07 16:08:24 +02:00
Paulus Schoutsen
6de02fc1b9
Fix some more usages of asynctest ( #39570 )
2020-09-02 14:53:07 +02:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 ( #39287 )
2020-08-27 13:56:20 +02:00