Commit Graph

317 Commits

Author SHA1 Message Date
2c13c70e12 Update ruff to 0.12.0 (#147106) 2025-06-19 20:39:09 +02:00
0128d85999 Move sun conditions to the sun integration (#144742) 2025-05-12 23:03:37 +01:00
05324dedd0 Deduplicate condition schemas (#144739) 2025-05-12 15:38:31 +02:00
16b42cc109 Add cv.renamed (#143834) 2025-04-29 07:36:37 +02:00
bb73ecc1f4 Restore service call performance by avoiding expensive runtime cast (#143378)
Improve service call performance by avoiding expensive runtime type checking

Most of the overhead here was casting
2025-04-21 09:37:10 -04:00
93561543ff Improve code quality of condition validation (#141292)
Streamline condition validation
2025-03-24 17:21:32 +01:00
b7a344fd65 Standardize homeassistant imports in core and base platforms (#136730)
Standardize homeassistant imports in core
2025-01-28 13:11:48 -05:00
8a35261fd8 Remove unused noqas (#135583) 2025-01-15 10:02:18 +01:00
239aa94b6f Update Python version for mypy to 3.13 (#135636) 2025-01-15 01:43:13 +01:00
ee74a35417 Support time entities in time conditions (#124575)
Co-authored-by: Mark Bergsma <mark@wikked.net>
2024-11-26 15:37:31 +01:00
7045b776b6 Use report_usage in helpers (#130365) 2024-11-12 09:25:13 +01:00
2236ca3e12 Fix typo in cv.url_no_path (#129402) 2024-10-29 12:06:59 +01:00
3810c3cbaf Improve trigger schema validation to ask for trigger instead of platform (#126750)
* Add check for missing trigger

* Fix

* Fix

* Escape
2024-09-25 16:44:14 +02:00
a1906b434f Change trigger platform key to trigger (#124357)
* fix

* Fix

* Fix

* Update homeassistant/helpers/config_validation.py

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

* Fix

* Fix

* Fix

* Fix

* Add more tests

* Fix

* Fix tests

* Add tests

* Let's see what the CI does

* It fails on the code that tested the thing ofc

* It fails on the code that tested the thing ofc

* Revert test thingy

* Now the test works again, lovely

* Another one

* Fix websocket thingy

* Only copy when needed

* Improve comment

* Remove test

* Fix docstring

* I think this now also work since this transforms trigger to platform

* Add comment

* Update homeassistant/helpers/config_validation.py

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

* Update homeassistant/helpers/config_validation.py

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

* Update homeassistant/helpers/config_validation.py

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

* Check for mapping

* Add test

* Update homeassistant/helpers/config_validation.py

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

* Update test to also test for trigger keys

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-09-25 14:19:58 +02:00
cd95c133af Enable all TID ruff rules (#126312)
* Enable ruff rule TID252

* One more

* comment
2024-09-20 12:25:51 +02:00
ded34561b1 Simplify cv._base_trigger_list_flatten (#125613) 2024-09-09 21:14:41 +02:00
056e6eae82 Add a syntax for merging lists of triggers (#117698)
* Add a syntax for merging lists of triggers

* Updating to the new syntax

* Update homeassistant/helpers/config_validation.py

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

* fix suggestion

* update test and add comments

* not actually json

* move test to new file

* update tests

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-09-09 13:51:32 +02:00
c321bd70e1 Log deprecation warning when cv.template is called from wrong thread (#125141)
Log deprecation warning when cv.template is called from wrong thread
2024-09-03 14:37:21 +02:00
174f22aa2f Prevent nesting sections in data entry flows (#124645) 2024-08-28 15:42:15 +02:00
55c42fde88 Improve validation of entity service schemas (#124102)
* Improve validation of entity service schemas

* Update tests/helpers/test_entity_platform.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-27 19:05:49 +02:00
533442f33e Add async friendly helper for validating config schemas (#123800)
* Add async friendly helper for validating config schemas

* Improve docstrings

* Add tests
2024-08-17 11:01:49 +02:00
f1b7847d1c Simplify cv._make_entity_service_schema (#124046) 2024-08-16 14:09:09 +02:00
7063541733 Support None schema in EntityPlatform.async_register_entity_service (#123064) 2024-08-14 10:46:29 +02:00
ddc94030a6 Fix raise-within-try in config validation helper (#123353) 2024-08-08 18:50:49 +02:00
8b96c7873f Rename 'service' to 'action' in automations and scripts (#122845) 2024-07-31 14:36:53 +02:00
6bceb8ec48 Add some more VolDictType annotations (#120610) 2024-06-26 22:44:43 +02:00
d527113d59 Improve schema typing (3) (#120521) 2024-06-26 11:30:07 +02:00
49df0c4366 Improve schema typing (2) (#120475) 2024-06-26 02:25:30 +02:00
0545ed8082 Section support for data entry flows (#118369)
* Add expandable support for data entry form flows

* Update config_validation.py

* optional options

* Adjust

* Correct translations of data within sections

* Update homeassistant/components/kitchen_sink/config_flow.py

Co-authored-by: Robert Resch <robert@resch.dev>

* Add missing import

* Update tests/components/kitchen_sink/test_config_flow.py

Co-authored-by: Robert Resch <robert@resch.dev>

* Format code

* Match frontend when serializing

* Move section class to data_entry_flow

* Correct serializing

* Fix import in kitchen_sink

* Move and update test

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Robert Resch <robert@resch.dev>
2024-06-25 11:02:00 +02:00
c368ffffd5 Add async_get_hass_or_none (#118164) 2024-05-26 13:38:46 +02:00
9224997411 Add sequence action for automations & scripts (#117690)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-05-24 09:34:49 +02:00
58d0ac7f21 Remove future import to fix broken typing.get_type_hints call (#117837) 2024-05-21 09:39:47 +02:00
f50973c76c Use PEP 695 misc (#117788) 2024-05-20 12:01:49 +02:00
10dfa91e54 Remove useless TypeVars (#117687) 2024-05-18 12:58:51 +02:00
ec4c8ae228 Allow templates for enabling actions (#117049)
* Allow templates for enabling automation actions

* Use `cv.template` instead of `cv.template_complex`

* Rename test function
2024-05-15 21:03:52 +02:00
076f57ee07 Allow templates for enabling conditions (#117047)
* Allow templates for enabling automation conditions

* Use `cv.template` instead of `cv.template_complex`
2024-05-15 21:03:28 +02:00
ba48da7678 Allow templates for enabling automation triggers (#114458)
* Allow templates for enabling automation triggers

* Test exception for non-limited template

* Use `cv.template` instead of `cv.template_complex`

* skip trigger with invalid enable template

instead of returning and thus not evaluating other triggers
2024-05-14 14:44:21 +02:00
Sid
b37f7b1ff0 Enable Ruff RUF019 (#115396)
* Enable Ruff RUF019

* fix tado tests

* review comments
2024-04-24 07:23:24 +02:00
bfe944f666 Handle ambiguous script actions by using action map order (#114825) 2024-04-05 08:42:57 +02:00
Sid
6587ee20db Enable Ruff TRY300 (#114437)
* Enable Ruff TRY300

* Update validation.py

* Address review comments
2024-03-30 10:37:59 +01:00
9a1906322b Allow numeric state trigger/condition against zone entities (#114221) 2024-03-26 19:41:46 +01:00
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
aebc95b1d2 Reduce overhead to construct and validate entity service schema (#113920) 2024-03-20 16:07:17 -10:00
e015fd2440 Use intersection for determine_script_action (#113915) 2024-03-20 16:06:59 -10:00
167e66d45c Add labels to service target (#113753) 2024-03-18 22:32:23 +01:00
Sid
6ee273a548 Clean up unneeded ruff noqa directives (#113616) 2024-03-16 09:48:37 -10:00
2aadd643ed Add floors to service target (#110850) 2024-03-14 19:02:23 +01:00
aa7acb89c5 Remove Python 3.11 from CI (#112626) 2024-03-08 17:42:18 +01:00
19ab3d6daf Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
da6eca7b68 Avoid compiling entity service schema when passed defaults (#112099)
* Avoid compiling entity service schema when passed defaults

* dry
2024-03-03 12:50:04 -05:00