Commit graph

262 commits

Author SHA1 Message Date
Erik Montnemery
3bcc6194ef
Add domain key config validation ()
* 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 () 2023-12-04 20:36:16 +01:00
Ville Skyttä
5551a345ea
Remove some unnecessary uses of regular expressions () 2023-10-03 20:55:00 -05:00
Ville Skyttä
f4bf8fa8f1
Catch HTML case insensitively in "no HTML" config validation () 2023-10-01 16:19:24 +02:00
Ville Skyttä
6399d74c15
Remove unnnecessary pylint configs from core () 2023-08-22 23:12:12 +02:00
Ville Skyttä
3094991236
Upgrade ruff to 0.0.285 () 2023-08-19 08:17:17 -04:00
Erik Montnemery
7fcc2dd44e
Make the check_config script open issue_registry read only ()
* 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 () 2023-07-23 23:19:24 +02:00
Jan Bouwhuis
9424d11408
Allow homeassistant in MQTT configuration_url schema () 2023-07-22 22:50:58 +02:00
Erik Montnemery
f46188c85a
Improve the docstring of some config schema generators () 2023-07-11 11:34:16 +02:00
Jan Bouwhuis
18ee9f4725
Refactor async_get_hass to rely on threading.local instead of a ContextVar ()
* 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 ()
* 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 () 2023-06-27 19:38:30 +02:00
Franck Nijhof
3e85a29b86
Move overlapping pylint rules to ruff, disable mypy overlap () 2023-06-27 17:42:46 +02:00
Erik Montnemery
cb22fb16f8
Allow returning a script variable from a script ()
* 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 () 2023-06-27 08:24:22 +02:00
Allen Porter
c4284c07b6
Allow scripts to capture service response data in variables ()
* 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 () 2023-06-08 18:22:34 +02:00
Erik Montnemery
f9037d5f6d
Add platform only config schema to nsw_fuel_station and ping () 2023-06-01 17:30:15 +02:00
Erik Montnemery
c1c319d4d1
Rename cv.no_yaml_config_schema to cv.config_entry_only_config_schema ()
* 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 ()
* 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 () 2023-05-29 21:01:47 +02:00
Erik Montnemery
49c3a8886f
Make cv.empty_config_schema log an error instead of raise ()
* 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 () 2023-05-26 16:29:32 +02:00
J. Nick Koston
93bfd7d8d0
Small speed up to validating entity ids () 2023-05-12 15:04:09 +02:00
Erik Montnemery
18cb53a35c
Pass hass instance when validating templates ()
* 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 () 2023-02-20 18:57:00 +01:00
Franck Nijhof
9030ca05b1
Enable Ruff SIM118 () 2023-02-15 12:39:12 +01:00
epenet
810367b757
Fix can not typo () 2023-02-03 11:37:16 +01:00
Franck Nijhof
79b52a2b41
Stricter pylint message control () 2023-01-20 13:47:55 +01:00
Franck Nijhof
06a35fb7db
Code styling tweaks to core helpers () 2023-01-08 13:44:09 -10:00
epenet
9f7fd8956f
Use new unit enums in helpers () 2022-12-06 22:20:17 +01:00
Erik Montnemery
e1338adf1a
Allow configuring country and language in core config ()
* Allow configuring country and language in core config

* Add script for updating list of countries

* Use black for formatting

* Fix quoting

* Move country codes to a separate file

* Address review comments

* Add generated/countries.py

* Get default language from owner account

* Remove unused variable

* Add script to generate list of supported languages

* Add tests

* Fix stale docsring

* Use format_python_namespace

* Correct async_user_store

* Improve typing

* Fix with_store decorator

* Initialize language in core store migration

* Fix startup

* Tweak

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Update storage.py

Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-11-24 23:25:50 +01:00
Jan Bouwhuis
23bc39b7f4
Add type hints on Template().__init__() () 2022-11-23 20:26:55 +01:00
Aarni Koskela
4f7b583f19
Fix shadowing of outer name in config_validation ()
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-11-16 14:04:57 +01:00
Erik Montnemery
c3d4a9cd99
Create repairs issue if an outdated currency code is configured ()
* Create repairs issue if an outdated currency code is configured

* Add script for updating list of currencies

* Use black for formatting

* Move currency codes to a separate file

* Address review comments
2022-11-08 07:21:09 +01:00
epenet
bff5d1123f
Deprecate CONF_UNIT_SYSTEM_*** constants ()
* Deprecate CONF_UNIT_SYSTEM_*** constants

* Adjust pylint plugin

* Add tests

* Remove single-use function

* Revert logic change

* Revert "Revert logic change"

This reverts commit 60959a0050.

* Tweak again
2022-10-14 16:50:04 +02:00
Erik Montnemery
18033532ca
Fix search throwing on templated services () 2022-10-05 10:59:18 +03:00
Franck Nijhof
9843753f30
Add alias support to all triggers () 2022-08-22 17:43:09 -04:00
epenet
a92105171c
Remove vizio from mypy ignore list ()
* Remove vizio config_flow from mypy ignore list

* Fix mypy errors

* Adjust media_player

* Add space
2022-06-19 21:39:24 +02:00
Franck Nijhof
682ac52a20
Support shorthand logical operators in script sequences () 2022-04-29 18:06:21 +02:00
Erik Montnemery
f6d9c75476
Remove metadata from device conditions and triggers () 2022-04-25 09:48:24 -07:00
Franck Nijhof
35687def02
Merge stop & error script actions () 2022-04-20 14:22:37 -07:00
Erik Montnemery
64381acbaf
Mark device actions from hidden or auxiliary entities as secondary () 2022-04-20 10:48:46 -07:00
Thomas Lovén
b50f369fe4
Add shorthand notation for boolean conditions () 2022-04-18 22:09:09 +02:00
Franck Nijhof
1b48d7eda1
Add for each item support to repeat action () 2022-04-15 19:10:25 +02:00
Franck Nijhof
e04fef3c2d
Allow disabling specific triggers/actions/conditions () 2022-04-15 09:33:09 -07:00
Franck Nijhof
cdabcce83a
Add ability to continue scripts/automations on error () 2022-04-14 13:43:14 -07:00
Franck Nijhof
d704d4f853
Add parallel automation/script actions () 2022-04-13 13:07:44 -07:00
Erik Montnemery
a9742cc445
Drop frontend metadata from entity service schemas () 2022-04-12 18:09:06 +02:00