mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Config Validator: schema_with_slug_keys (#20298)
* schema_with_slug_keys * Update config_validation.py * Update config_validation.py
This commit is contained in:
committed by
Paulus Schoutsen
parent
4b3cdb9f4e
commit
6511e11ec9
@@ -329,6 +329,9 @@ def schema_with_slug_keys(value_schema: Union[T, Callable]) -> Callable:
|
||||
|
||||
def verify(value: Dict) -> Dict:
|
||||
"""Validate all keys are slugs and then the value_schema."""
|
||||
if not isinstance(value, dict):
|
||||
raise vol.Invalid('expected dictionary')
|
||||
|
||||
for key in value.keys():
|
||||
slug(key)
|
||||
return schema(value)
|
||||
|
||||
Reference in New Issue
Block a user