From 30f2a49fbff93b2f59d0ddd15848d47274d73a1e Mon Sep 17 00:00:00 2001 From: RoboMagus <68224306+RoboMagus@users.noreply.github.com> Date: Tue, 20 Jun 2023 17:53:33 +0200 Subject: [PATCH] Simplified update_types localizations --- ...omation-trigger-persistent_notification.ts | 35 ++++--------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-persistent_notification.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-persistent_notification.ts index f2fcb10c86..3243f50616 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-persistent_notification.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-persistent_notification.ts @@ -10,31 +10,7 @@ import { PersistentNotificationTrigger } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; import { handleChangeEvent } from "../ha-automation-trigger-row"; -const SUPPORTED_UPDATE_TYPES: { - value: string; - label: string; -}[] = [ - { - value: "added", - label: - "ui.panel.config.automation.editor.triggers.type.persistent_notification.update_types.added", - }, - { - value: "removed", - label: - "ui.panel.config.automation.editor.triggers.type.persistent_notification.update_types.removed", - }, - { - value: "current", - label: - "ui.panel.config.automation.editor.triggers.type.persistent_notification.update_types.current", - }, - { - value: "updated", - label: - "ui.panel.config.automation.editor.triggers.type.persistent_notification.update_types.updated", - }, -]; +const SUPPORTED_UPDATE_TYPES = ["added", "removed", "current", "updated"]; const DEFAULT_UPDATE_TYPES = ["added", "removed"]; const DEFAULT_NOTIFICATION_ID = ""; @@ -77,11 +53,13 @@ export class HaPersistentNotificationTrigger extends LitElement { (update_type) => html` - ${update_type.label} + ${this.hass.localize( + `ui.panel.config.automation.editor.triggers.type.persistent_notification.update_types.${update_type}` + )} @@ -105,7 +83,6 @@ export class HaPersistentNotificationTrigger extends LitElement { return; } - const updateTypes = this.trigger.update_type ?? []; const newUpdateTypes = this.trigger.update_type ? [...this.trigger.update_type] : [];