mirror of
https://github.com/home-assistant/core.git
synced 2025-08-02 10:08:23 +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:
|
def _validate_schema(value: dict[str, Any]) -> vol.Schema:
|
||||||
"""Validate the structure for the generate data task."""
|
"""Validate the structure for the generate data task and convert to a vol Schema."""
|
||||||
if not isinstance(value, dict):
|
if not isinstance(value, dict):
|
||||||
raise vol.Invalid("Structure must be a dictionary")
|
raise vol.Invalid("Structure must be a dictionary")
|
||||||
fields = {}
|
fields = {}
|
||||||
@ -92,7 +92,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
vol.Required(ATTR_INSTRUCTIONS): cv.string,
|
vol.Required(ATTR_INSTRUCTIONS): cv.string,
|
||||||
vol.Optional(ATTR_STRUCTURE): vol.All(
|
vol.Optional(ATTR_STRUCTURE): vol.All(
|
||||||
vol.Schema({str: STRUCTURE_FIELD_SCHEMA}),
|
vol.Schema({str: STRUCTURE_FIELD_SCHEMA}),
|
||||||
_validate_structure,
|
_validate_schema,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user