From ce5246a8cdc7ddba85e9bc07a556c3ad08726726 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 12 Jul 2023 13:47:47 +0200 Subject: [PATCH] Migrate homeassistant services to support translations (#96388) Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --- .../components/homeassistant/services.yaml | 41 ------------ .../components/homeassistant/strings.json | 66 +++++++++++++++++++ 2 files changed, 66 insertions(+), 41 deletions(-) diff --git a/homeassistant/components/homeassistant/services.yaml b/homeassistant/components/homeassistant/services.yaml index 2fe27769c3f..899fee357fd 100644 --- a/homeassistant/components/homeassistant/services.yaml +++ b/homeassistant/components/homeassistant/services.yaml @@ -1,88 +1,47 @@ check_config: - name: Check configuration - description: - Check the Home Assistant configuration files for errors. Errors will be - displayed in the Home Assistant log. - reload_core_config: - name: Reload core configuration - description: Reload the core configuration. - restart: - name: Restart - description: Restart the Home Assistant service. - set_location: - name: Set location - description: Update the Home Assistant location. fields: latitude: - name: Latitude - description: Latitude of your location. required: true example: 32.87336 selector: text: longitude: - name: Longitude - description: Longitude of your location. required: true example: 117.22743 selector: text: stop: - name: Stop - description: Stop the Home Assistant service. - toggle: - name: Generic toggle - description: Generic service to toggle devices on/off under any domain target: entity: {} turn_on: - name: Generic turn on - description: Generic service to turn devices on under any domain. target: entity: {} turn_off: - name: Generic turn off - description: Generic service to turn devices off under any domain. target: entity: {} update_entity: - name: Update entity - description: Force one or more entities to update its data target: entity: {} reload_custom_templates: - name: Reload custom Jinja2 templates - description: >- - Reload Jinja2 templates found in the custom_templates folder in your config. - New values will be applied on the next render of the template. - reload_config_entry: - name: Reload config entry - description: Reload a config entry that matches a target. target: entity: {} device: {} fields: entry_id: advanced: true - name: Config entry id - description: A configuration entry id required: false example: 8955375327824e14ba89e4b29cc3ec9a selector: text: save_persistent_states: - name: Save Persistent States - description: - Save the persistent states (for entities derived from RestoreEntity) immediately. - Maintain the normal periodic saving interval. diff --git a/homeassistant/components/homeassistant/strings.json b/homeassistant/components/homeassistant/strings.json index 89da615cf31..5a02cd19665 100644 --- a/homeassistant/components/homeassistant/strings.json +++ b/homeassistant/components/homeassistant/strings.json @@ -45,5 +45,71 @@ "version": "Version", "virtualenv": "Virtual Environment" } + }, + "services": { + "check_config": { + "name": "Check configuration", + "description": "Checks the Home Assistant YAML-configuration files for errors. Errors will be shown in the Home Assistant logs." + }, + "reload_core_config": { + "name": "Reload core configuration", + "description": "Reloads the core configuration from the YAML-configuration." + }, + "restart": { + "name": "Restart", + "description": "Restarts Home Assistant." + }, + "set_location": { + "name": "Set location", + "description": "Updates the Home Assistant location.", + "fields": { + "latitude": { + "name": "Latitude", + "description": "Latitude of your location." + }, + "longitude": { + "name": "Longitude", + "description": "Longitude of your location." + } + } + }, + "stop": { + "name": "Stop", + "description": "Stops Home Assistant." + }, + "toggle": { + "name": "Generic toggle", + "description": "Generic service to toggle devices on/off under any domain." + }, + "turn_on": { + "name": "Generic turn on", + "description": "Generic service to turn devices on under any domain." + }, + "turn_off": { + "name": "Generic turn off", + "description": "Generic service to turn devices off under any domain." + }, + "update_entity": { + "name": "Update entity", + "description": "Forces one or more entities to update its data." + }, + "reload_custom_templates": { + "name": "Reload custom Jinja2 templates", + "description": "Reloads Jinja2 templates found in the `custom_templates` folder in your config. New values will be applied on the next render of the template." + }, + "reload_config_entry": { + "name": "Reload config entry", + "description": "Reloads the specified config entry.", + "fields": { + "entry_id": { + "name": "Config entry ID", + "description": "The configuration entry ID of the entry to be reloaded." + } + } + }, + "save_persistent_states": { + "name": "Save persistent states", + "description": "Saves the persistent states immediately. Maintains the normal periodic saving interval." + } } }