From 101e9323a7a02fe5295a5fd7bbe1d91c7f0eb444 Mon Sep 17 00:00:00 2001 From: RoboMagus <68224306+RoboMagus@users.noreply.github.com> Date: Tue, 20 Jun 2023 14:58:24 +0200 Subject: [PATCH] Review updates --- src/data/automation_i18n.ts | 2 +- ...omation-trigger-persistent_notification.ts | 48 ++++++++++++++----- src/translations/en.json | 8 +++- 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/src/data/automation_i18n.ts b/src/data/automation_i18n.ts index 689561b30d..b0ab6bb9f4 100644 --- a/src/data/automation_i18n.ts +++ b/src/data/automation_i18n.ts @@ -602,7 +602,7 @@ export const describeTrigger = ( // Persistent Notification Trigger if (trigger.platform === "persistent_notification") { - return "When a persistent_notification is updated"; + return "When a persistent notification is updated"; } // Device Trigger 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 4f1975a8c7..f2fcb10c86 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,7 +10,31 @@ import { PersistentNotificationTrigger } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; import { handleChangeEvent } from "../ha-automation-trigger-row"; -const SUPPORTED_UPDATE_TYPES = ["added", "removed", "current", "updated"]; +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 DEFAULT_UPDATE_TYPES = ["added", "removed"]; const DEFAULT_NOTIFICATION_ID = ""; @@ -30,10 +54,8 @@ export class HaPersistentNotificationTrigger extends LitElement { } protected render() { - const { - update_type: updateTypes, - notification_id: notificationId, - } = this.trigger; + const { update_type: updateTypes, notification_id: notificationId } = + this.trigger; return html`