From 7322fe40da30cfc021561d3d099ef7a663ec8da2 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Tue, 24 Jun 2025 21:00:14 +0200 Subject: [PATCH] Define fields for assist ask_question action (#147219) * Define fields for assist ask_question action * Update hassfest --------- Co-authored-by: Paulus Schoutsen --- .../components/assist_satellite/services.yaml | 14 ++++++++++++++ .../components/assist_satellite/strings.json | 8 ++++++++ script/hassfest/translations.py | 5 +++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/assist_satellite/services.yaml b/homeassistant/components/assist_satellite/services.yaml index c5484e22dad..6beb0991861 100644 --- a/homeassistant/components/assist_satellite/services.yaml +++ b/homeassistant/components/assist_satellite/services.yaml @@ -86,3 +86,17 @@ ask_question: required: false selector: object: + label_field: sentences + description_field: id + multiple: true + translation_key: answers + fields: + id: + required: true + selector: + text: + sentences: + required: true + selector: + text: + multiple: true diff --git a/homeassistant/components/assist_satellite/strings.json b/homeassistant/components/assist_satellite/strings.json index e0bf2bcfb94..52df2492480 100644 --- a/homeassistant/components/assist_satellite/strings.json +++ b/homeassistant/components/assist_satellite/strings.json @@ -90,5 +90,13 @@ } } } + }, + "selector": { + "answers": { + "fields": { + "id": "Answer ID", + "sentences": "Sentences" + } + } } } diff --git a/script/hassfest/translations.py b/script/hassfest/translations.py index f4c05f504ca..34c06abb451 100644 --- a/script/hassfest/translations.py +++ b/script/hassfest/translations.py @@ -306,10 +306,11 @@ def gen_strings_schema(config: Config, integration: Integration) -> vol.Schema: ), vol.Optional("selector"): cv.schema_with_slug_keys( { - "options": cv.schema_with_slug_keys( + vol.Optional("options"): cv.schema_with_slug_keys( translation_value_validator, slug_validator=translation_key_validator, - ) + ), + vol.Optional("fields"): cv.schema_with_slug_keys(str), }, slug_validator=vol.Any("_", cv.slug), ),