Matthias Alphart
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
Matthias Alphart
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
J. Nick Koston
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
Franck Nijhof
9a1906322b
Allow numeric state trigger/condition against zone entities ( #114221 )
2024-03-26 19:41:46 +01:00
Joost Lekkerkerker
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
J. Nick Koston
aebc95b1d2
Reduce overhead to construct and validate entity service schema ( #113920 )
2024-03-20 16:07:17 -10:00
J. Nick Koston
e015fd2440
Use intersection for determine_script_action ( #113915 )
2024-03-20 16:06:59 -10:00
Franck Nijhof
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
Franck Nijhof
2aadd643ed
Add floors to service target ( #110850 )
2024-03-14 19:02:23 +01:00
Franck Nijhof
aa7acb89c5
Remove Python 3.11 from CI ( #112626 )
2024-03-08 17:42:18 +01:00
Marc Mueller
19ab3d6daf
Add empty line after module docstring [helpers + other] ( #112707 )
2024-03-08 10:36:11 -05:00
J. Nick Koston
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
J. Nick Koston
6421a08ba8
Avoid expensive inspect calls in config validators ( #112085 )
...
* Avoid expensive inspect calls in config validators
inspect has a performance problem https://github.com/python/cpython/issues/92041
We now avoid calling inspect unless we are going to log
* remove unused
* reduce
* get_integration_logger
2024-03-02 21:50:35 -05:00
Franck Nijhof
67ac60d042
Add hex color validator ( #110846 )
2024-02-18 16:03:21 +01:00
Marc Mueller
d2dee9e327
Update ruff to 0.1.15 ( #109303 )
2024-02-01 13:29:01 +01:00
Erik Montnemery
3ce4e53b32
Sort script actions ( #108247 )
2024-01-31 20:41:53 +01:00
Erik Montnemery
9bff039d17
Add set_conversation_response script action ( #108233 )
...
* Add set_conversation_response script action
* Update homeassistant/components/conversation/trigger.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Revert accidental change
* Add test
* Ignore mypy
* Remove incorrect callback decorator
* Update homeassistant/helpers/script.py
* Add test with templated set_conversation_response
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-01-23 09:13:42 -05:00
Erik Montnemery
3bcc6194ef
Add domain key config validation ( #104242 )
...
* Drop use of regex in helpers.extract_domain_configs
* Update test
* Revert test update
* Add domain_from_config_key helper
* Add validator
* Address review comment
* Update snapshots
* Inline domain_from_config_key in validator
2023-12-05 15:07:32 +01:00
Erik Montnemery
35e2f591c1
Make `cv.string` return subclasses of str as is ( #103916 )
2023-12-04 20:36:16 +01:00
Ville Skyttä
5551a345ea
Remove some unnecessary uses of regular expressions ( #101182 )
2023-10-03 20:55:00 -05:00
Ville Skyttä
f4bf8fa8f1
Catch HTML case insensitively in "no HTML" config validation ( #101181 )
2023-10-01 16:19:24 +02:00
Ville Skyttä
6399d74c15
Remove unnnecessary pylint configs from core ( #98704 )
2023-08-22 23:12:12 +02:00
Ville Skyttä
3094991236
Upgrade ruff to 0.0.285 ( #98647 )
2023-08-19 08:17:17 -04:00
Erik Montnemery
7fcc2dd44e
Make the check_config script open issue_registry read only ( #98545 )
...
* Don't blow up if validators can't access the issue registry
* Make the check_config script open issue_registry read only
* Update tests/helpers/test_issue_registry.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-08-18 20:15:00 +02:00
Franck Nijhof
30058297cf
Migrate backported StrEnum to built-in StrEnum ( #97101 )
2023-07-23 23:19:24 +02:00
Jan Bouwhuis
9424d11408
Allow homeassistant in MQTT configuration_url schema ( #96107 )
2023-07-22 22:50:58 +02:00
Erik Montnemery
f46188c85a
Improve the docstring of some config schema generators ( #96296 )
2023-07-11 11:34:16 +02:00
Jan Bouwhuis
18ee9f4725
Refactor async_get_hass to rely on threading.local instead of a ContextVar ( #96005 )
...
* Test for async_get_hass
* Add Fix
2023-07-07 14:52:38 -04:00
Erik Montnemery
e18f7dffb0
Teach validate_config to validate lists of conditions ( #95380 )
...
* Teach validate_config to validate lists of conditions
* Update test
2023-06-27 19:44:23 +02:00
Paulus Schoutsen
243abf32c0
Add test to stop action ( #95376 )
2023-06-27 19:38:30 +02:00
Franck Nijhof
3e85a29b86
Move overlapping pylint rules to ruff, disable mypy overlap ( #94359 )
2023-06-27 17:42:46 +02:00
Erik Montnemery
cb22fb16f8
Allow returning a script variable from a script ( #95346 )
...
* Allow returning a script variable from a script
* Don't allow returning a template result
* Raise if response variable is undefined
* Add test
* Update homeassistant/helpers/script.py
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Format code
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-06-27 17:13:53 +02:00
Paulus Schoutsen
5f14cdf69d
Allow stopping a script with a response value ( #95284 )
2023-06-27 08:24:22 +02:00
Allen Porter
c4284c07b6
Allow scripts to capture service response data in variables ( #94757 )
...
* Allow scripts service actions to save return values
* Simplify script service response data
* Rename result_variable to response_variable based on feedback
2023-06-16 22:59:44 -04:00
Franck Nijhof
6db1fbf480
Fix repair issue about no yaml for config entries ( #94271 )
2023-06-08 18:22:34 +02:00
Erik Montnemery
f9037d5f6d
Add platform only config schema to nsw_fuel_station and ping ( #93913 )
2023-06-01 17:30:15 +02:00
Erik Montnemery
c1c319d4d1
Rename `cv.no_yaml_config_schema` to `cv.config_entry_only_config_schema` ( #93908 )
...
* Rename cv.no_yaml_config_schema to cv.config_entry_only_config_schema
* ✏️
2023-06-01 13:15:48 +02:00
Erik Montnemery
e0db9ab041
Add CONFIG_SCHEMA to broadlink ( #93854 )
...
* Add CONFIG_SCHEMA to broadlink
* Simplify error message
* Rename to no_yaml_config_schema
* Add tests
* Raise issue
* Tweak repairs issue description and title
* Update homeassistant/helpers/config_validation.py
* Add link
* Update homeassistant/components/homeassistant/strings.json
Co-authored-by: Franck Nijhof <git@frenck.dev>
* Fix logic, add test
---------
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-06-01 09:51:26 +02:00
Erik Montnemery
8b662dc94f
Detect attempt to setup config entry integration via YAML ( #93589 )
2023-05-29 21:01:47 +02:00
Erik Montnemery
49c3a8886f
Make cv.empty_config_schema log an error instead of raise ( #93646 )
...
* Make cv.empty_config_schema log an error instead of raise
* Add test
* Update homeassistant/helpers/config_validation.py
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
---------
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2023-05-28 15:54:22 +02:00
Erik Montnemery
d4462829f5
Add CONFIG_SCHEMA to analytics ( #93598 )
2023-05-26 16:29:32 +02:00
J. Nick Koston
93bfd7d8d0
Small speed up to validating entity ids ( #92970 )
2023-05-12 15:04:09 +02:00
Erik Montnemery
18cb53a35c
Pass hass instance when validating templates ( #89242 )
...
* Pass hass instance when validating templates
* Update tests
* Fix validating templates without hass
* Update service tests
2023-03-08 11:28:53 -05:00
Erik Montnemery
cc4a179ca8
Support templating for in state conditions ( #88411 )
2023-02-20 18:57:00 +01:00
Franck Nijhof
9030ca05b1
Enable Ruff SIM118 ( #87772 )
2023-02-15 12:39:12 +01:00
epenet
810367b757
Fix `can not` typo ( #87254 )
2023-02-03 11:37:16 +01:00
Franck Nijhof
79b52a2b41
Stricter pylint message control ( #86154 )
2023-01-20 13:47:55 +01:00