mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Extend checks
This commit is contained in:
parent
df6763328f
commit
6e4b5f31d4
@ -1390,6 +1390,9 @@ def _raise_on_templated_service(
|
|||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Template in service data is not allowed! {domain}.{_service}:{key}"
|
f"Template in service data is not allowed! {domain}.{_service}:{key}"
|
||||||
)
|
)
|
||||||
|
if isinstance(val, (vol.All, vol.Any)):
|
||||||
|
for subval in val.validators:
|
||||||
|
raise_on_templated_service(domain, _service, subval)
|
||||||
|
|
||||||
|
|
||||||
def raise_on_templated_service(
|
def raise_on_templated_service(
|
||||||
@ -1406,6 +1409,10 @@ def raise_on_templated_service(
|
|||||||
raise_on_templated_service(domain, _service, val)
|
raise_on_templated_service(domain, _service, val)
|
||||||
if isinstance(schema, (vol.Schema)):
|
if isinstance(schema, (vol.Schema)):
|
||||||
raise_on_templated_service(domain, _service, schema.schema)
|
raise_on_templated_service(domain, _service, schema.schema)
|
||||||
|
if schema in (dynamic_template, template, template_complex):
|
||||||
|
raise ValueError(
|
||||||
|
f"Template in service data is not allowed! {domain}.{_service}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def make_entity_service_schema(
|
def make_entity_service_schema(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user