From d3eda12af4345e8b32530f5632947812adea5f7f Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 12 Jul 2023 17:28:05 +0200 Subject: [PATCH] Migrate recorder services to support translations (#96409) Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --- .../components/recorder/services.yaml | 21 --------- .../components/recorder/strings.json | 46 +++++++++++++++++++ 2 files changed, 46 insertions(+), 21 deletions(-) diff --git a/homeassistant/components/recorder/services.yaml b/homeassistant/components/recorder/services.yaml index f099cede9f2..b74dcc2a494 100644 --- a/homeassistant/components/recorder/services.yaml +++ b/homeassistant/components/recorder/services.yaml @@ -1,12 +1,8 @@ # Describes the format for available recorder services purge: - name: Purge - description: Start purge task - to clean up old data from your database. fields: keep_days: - name: Days to keep - description: Number of history days to keep in database after purge. selector: number: min: 0 @@ -14,28 +10,20 @@ purge: unit_of_measurement: days repack: - name: Repack - description: Attempt to save disk space by rewriting the entire database file. default: false selector: boolean: apply_filter: - name: Apply filter - description: Apply entity_id and event_type filter in addition to time based purge. default: false selector: boolean: purge_entities: - name: Purge Entities - description: Start purge task to remove specific entities from your database. target: entity: {} fields: domains: - name: Domains to remove - description: List the domains that need to be removed from the recorder database. example: "sun" required: false default: [] @@ -43,8 +31,6 @@ purge_entities: object: entity_globs: - name: Entity Globs to remove - description: List the glob patterns to select entities for removal from the recorder database. example: "domain*.object_id*" required: false default: [] @@ -52,8 +38,6 @@ purge_entities: object: keep_days: - name: Days to keep - description: Number of history days to keep in database of matching rows. The default of 0 days will remove all matching rows. default: 0 selector: number: @@ -62,9 +46,4 @@ purge_entities: unit_of_measurement: days disable: - name: Disable - description: Stop the recording of events and state changes - enable: - name: Enable - description: Start the recording of events and state changes diff --git a/homeassistant/components/recorder/strings.json b/homeassistant/components/recorder/strings.json index 7af67f10e25..a55f13b27c4 100644 --- a/homeassistant/components/recorder/strings.json +++ b/homeassistant/components/recorder/strings.json @@ -13,5 +13,51 @@ "title": "Update MariaDB to {min_version} or later resolve a significant performance issue", "description": "Older versions of MariaDB suffer from a significant performance regression when retrieving history data or purging the database. Update to MariaDB version {min_version} or later and restart Home Assistant. If you are using the MariaDB core add-on, make sure to update it to the latest version." } + }, + "services": { + "purge": { + "name": "Purge", + "description": "Starts purge task - to clean up old data from your database.", + "fields": { + "keep_days": { + "name": "Days to keep", + "description": "Number of days to keep the data in the database. Starting today, counting backward. A value of `7` means that everything older than a week will be purged." + }, + "repack": { + "name": "Repack", + "description": "Attempt to save disk space by rewriting the entire database file." + }, + "apply_filter": { + "name": "Apply filter", + "description": "Applys `entity_id` and `event_type` filters in addition to time-based purge." + } + } + }, + "purge_entities": { + "name": "Purge entities", + "description": "Starts a purge task to remove the data related to specific entities from your database.", + "fields": { + "domains": { + "name": "Domains to remove", + "description": "List of domains for which the data needs to be removed from the recorder database." + }, + "entity_globs": { + "name": "Entity globs to remove", + "description": "List of glob patterns used to select the entities for which the data is to be removed from the recorder database." + }, + "keep_days": { + "name": "Days to keep", + "description": "Number of days to keep the data for rows matching the filter. Starting today, counting backward. A value of `7` means that everything older than a week will be purged. The default of 0 days will remove all matching rows immediately." + } + } + }, + "disable": { + "name": "Disable", + "description": "Stops the recording of events and state changes." + }, + "enable": { + "name": "Enable", + "description": "Starts the recording of events and state changes." + } } }