mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 17:48:26 +00:00
Rename _validate_structure to _validate_schema
This commit is contained in:
parent
789eb029fa
commit
afa30be64b
@ -59,8 +59,8 @@ STRUCTURE_FIELD_SCHEMA = vol.Schema(
|
||||
)
|
||||
|
||||
|
||||
def _validate_structure(value: dict[str, Any]) -> vol.Schema:
|
||||
"""Validate the structure for the generate data task."""
|
||||
def _validate_schema(value: dict[str, Any]) -> vol.Schema:
|
||||
"""Validate the structure for the generate data task and convert to a vol Schema."""
|
||||
if not isinstance(value, dict):
|
||||
raise vol.Invalid("Structure must be a dictionary")
|
||||
fields = {}
|
||||
@ -92,7 +92,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
vol.Required(ATTR_INSTRUCTIONS): cv.string,
|
||||
vol.Optional(ATTR_STRUCTURE): vol.All(
|
||||
vol.Schema({str: STRUCTURE_FIELD_SCHEMA}),
|
||||
_validate_structure,
|
||||
_validate_schema,
|
||||
),
|
||||
}
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user