diff --git a/src/data/persistent_notification.ts b/src/data/persistent_notification.ts
index 9ae0447537fa..64a7ba467012 100644
--- a/src/data/persistent_notification.ts
+++ b/src/data/persistent_notification.ts
@@ -11,11 +11,17 @@ export interface PersitentNotificationEntity extends HassEntity {
message?: string;
}
+export interface PersistentNotificationAction {
+ action: string;
+ title: string;
+}
+
export interface PersistentNotification {
created_at: string;
message: string;
notification_id: string;
title: string;
+ actions?: PersistentNotificationAction[];
status: "read" | "unread";
}
diff --git a/src/dialogs/notifications/persistent-notification-item.ts b/src/dialogs/notifications/persistent-notification-item.ts
index 16a615296511..05706c4953fb 100644
--- a/src/dialogs/notifications/persistent-notification-item.ts
+++ b/src/dialogs/notifications/persistent-notification-item.ts
@@ -39,6 +39,16 @@ export class HuiPersistentNotificationItem extends LitElement {
+ ${this.notification.actions?.map(
+ (a) =>
+ html` ${a.title}`
+ )}
+
${this.hass.localize(
"ui.card.persistent_notification.dismiss"
@@ -67,6 +77,17 @@ export class HuiPersistentNotificationItem extends LitElement {
`;
}
+ private _handleAction(ev): void {
+ this.hass?.callApi(
+ "POST",
+ `events/persistent_notification_action`,
+ ev.currentTarget.action
+ );
+ this.hass!.callService("persistent_notification", "dismiss", {
+ notification_id: this.notification!.notification_id,
+ });
+ }
+
private _handleDismiss(): void {
this.hass!.callService("persistent_notification", "dismiss", {
notification_id: this.notification!.notification_id,