From aca91db8b574f912351a3d2dc8a9a34c58698231 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 12 Jul 2023 13:49:51 +0200 Subject: [PATCH] Migrate water_heater services to support translations (#96389) Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --- .../components/water_heater/services.yaml | 14 -------- .../components/water_heater/strings.json | 36 +++++++++++++++++++ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/homeassistant/components/water_heater/services.yaml b/homeassistant/components/water_heater/services.yaml index a3b372f219e..b42109ee649 100644 --- a/homeassistant/components/water_heater/services.yaml +++ b/homeassistant/components/water_heater/services.yaml @@ -1,29 +1,21 @@ # Describes the format for available water_heater services set_away_mode: - name: Set away mode - description: Turn away mode on/off for water_heater device. target: entity: domain: water_heater fields: away_mode: - name: Away mode - description: New value of away mode. required: true selector: boolean: set_temperature: - name: Set temperature - description: Set target temperature of water_heater device. target: entity: domain: water_heater fields: temperature: - name: Temperature - description: New target temperature for water heater. required: true selector: number: @@ -32,22 +24,16 @@ set_temperature: step: 0.5 unit_of_measurement: "°" operation_mode: - name: Operation mode - description: New value of operation mode. example: eco selector: text: set_operation_mode: - name: Set operation mode - description: Set operation mode for water_heater device. target: entity: domain: water_heater fields: operation_mode: - name: Operation mode - description: New value of operation mode. required: true example: eco selector: diff --git a/homeassistant/components/water_heater/strings.json b/homeassistant/components/water_heater/strings.json index b0a625d0016..a03e93cde41 100644 --- a/homeassistant/components/water_heater/strings.json +++ b/homeassistant/components/water_heater/strings.json @@ -18,5 +18,41 @@ "performance": "Performance" } } + }, + "services": { + "set_away_mode": { + "name": "Set away mode", + "description": "Turns away mode on/off.", + "fields": { + "away_mode": { + "name": "Away mode", + "description": "New value of away mode." + } + } + }, + "set_temperature": { + "name": "Set temperature", + "description": "Sets the target temperature.", + "fields": { + "temperature": { + "name": "Temperature", + "description": "New target temperature for the water heater." + }, + "operation_mode": { + "name": "Operation mode", + "description": "New value of the operation mode. For a list of possible modes, refer to the integration documentation." + } + } + }, + "set_operation_mode": { + "name": "Set operation mode", + "description": "Sets the operation mode.", + "fields": { + "operation_mode": { + "name": "[%key:component::water_heater::services::set_temperature::fields::operation_mode::name%]", + "description": "[%key:component::water_heater::services::set_temperature::fields::operation_mode::description%]" + } + } + } } }