From bde7d734b5ec673a20f8a369842865f2f83592fa Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 11 Jul 2023 23:17:54 +0200 Subject: [PATCH] Migrate automation services to support translations (#96306) * Migrate automation services to support translations * Apply suggestions from code review Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --- .../components/automation/services.yaml | 14 -------- .../components/automation/strings.json | 34 +++++++++++++++++++ 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/homeassistant/components/automation/services.yaml b/homeassistant/components/automation/services.yaml index 62d0988d770..6b3afdca335 100644 --- a/homeassistant/components/automation/services.yaml +++ b/homeassistant/components/automation/services.yaml @@ -1,46 +1,32 @@ # Describes the format for available automation services turn_on: - name: Turn on - description: Enable an automation. target: entity: domain: automation turn_off: - name: Turn off - description: Disable an automation. target: entity: domain: automation fields: stop_actions: - name: Stop actions - description: Stop currently running actions. default: true selector: boolean: toggle: - name: Toggle - description: Toggle (enable / disable) an automation. target: entity: domain: automation trigger: - name: Trigger - description: Trigger the actions of an automation. target: entity: domain: automation fields: skip_condition: - name: Skip conditions - description: Whether or not the conditions will be skipped. default: true selector: boolean: reload: - name: Reload - description: Reload the automation configuration. diff --git a/homeassistant/components/automation/strings.json b/homeassistant/components/automation/strings.json index 6f925fe090d..cfeafa856d2 100644 --- a/homeassistant/components/automation/strings.json +++ b/homeassistant/components/automation/strings.json @@ -44,5 +44,39 @@ } } } + }, + "services": { + "turn_on": { + "name": "Turn on", + "description": "Enables an automation." + }, + "turn_off": { + "name": "Turn off", + "description": "Disables an automation.", + "fields": { + "stop_actions": { + "name": "Stop actions", + "description": "Stops currently running actions." + } + } + }, + "toggle": { + "name": "Toggle", + "description": "Toggles (enable / disable) an automation." + }, + "trigger": { + "name": "Trigger", + "description": "Triggers the actions of an automation.", + "fields": { + "skip_condition": { + "name": "Skip conditions", + "description": "Defines whether or not the conditions will be skipped." + } + } + }, + "reload": { + "name": "Reload", + "description": "Reloads the automation configuration." + } } }