From afa30be64b304917bd19b9db85b87f4d34af2aa9 Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Thu, 3 Jul 2025 21:32:10 +0000 Subject: [PATCH] Rename _validate_structure to _validate_schema --- homeassistant/components/ai_task/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/ai_task/__init__.py b/homeassistant/components/ai_task/__init__.py index 47a9207218e..9bdb5d40d31 100644 --- a/homeassistant/components/ai_task/__init__.py +++ b/homeassistant/components/ai_task/__init__.py @@ -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, ), } ),