From 7021daf9fba7d8c9360c0bc8d4361b05d92873c9 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 12 Jul 2023 18:55:22 +0200 Subject: [PATCH] Migrate select services to support translations (#96411) Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --- homeassistant/components/select/services.yaml | 16 -------- homeassistant/components/select/strings.json | 40 +++++++++++++++++++ 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/homeassistant/components/select/services.yaml b/homeassistant/components/select/services.yaml index 8fb55936fc9..dc6d4c6815a 100644 --- a/homeassistant/components/select/services.yaml +++ b/homeassistant/components/select/services.yaml @@ -1,56 +1,40 @@ select_first: - name: First - description: Select the first option of an select entity. target: entity: domain: select select_last: - name: Last - description: Select the last option of an select entity. target: entity: domain: select select_next: - name: Next - description: Select the next options of an select entity. target: entity: domain: select fields: cycle: - name: Cycle - description: If the option should cycle from the last to the first. default: true selector: boolean: select_option: - name: Select - description: Select an option of an select entity. target: entity: domain: select fields: option: - name: Option - description: Option to be selected. required: true example: '"Item A"' selector: text: select_previous: - name: Previous - description: Select the previous options of an select entity. target: entity: domain: select fields: cycle: - name: Cycle - description: If the option should cycle from the first to the last. default: true selector: boolean: diff --git a/homeassistant/components/select/strings.json b/homeassistant/components/select/strings.json index 9080b940b2a..d058ff6e6f2 100644 --- a/homeassistant/components/select/strings.json +++ b/homeassistant/components/select/strings.json @@ -24,5 +24,45 @@ } } } + }, + "services": { + "select_first": { + "name": "First", + "description": "Selects the first option." + }, + "select_last": { + "name": "Last", + "description": "Selects the last option." + }, + "select_next": { + "name": "Next", + "description": "Selects the next option.", + "fields": { + "cycle": { + "name": "Cycle", + "description": "If the option should cycle from the last to the first." + } + } + }, + "select_option": { + "name": "Select", + "description": "Selects an option.", + "fields": { + "option": { + "name": "Option", + "description": "Option to be selected." + } + } + }, + "select_previous": { + "name": "Previous", + "description": "Selects the previous option.", + "fields": { + "cycle": { + "name": "Cycle", + "description": "If the option should cycle from the first to the last." + } + } + } } }