[[localize('ui.notification_drawer.empty')]]
@@ -112,10 +124,23 @@ export class HuiNotificationDrawer extends EventsMixin(
this.open = false;
}
+ _dismissAll() {
+ this.notifications.forEach((notification) => {
+ this.hass.callService("persistent_notification", "dismiss", {
+ notification_id: notification.notification_id,
+ });
+ });
+ this.open = false;
+ }
+
_empty(notifications) {
return notifications.length === 0;
}
+ _moreThanOne(notifications) {
+ return notifications.length > 1;
+ }
+
_openChanged(open) {
if (open) {
// Render closed then animate open
diff --git a/src/translations/en.json b/src/translations/en.json
index 8316168abb..419d8f1ae0 100755
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -677,7 +677,8 @@
"click_to_configure": "Click button to configure {entity}",
"empty": "No Notifications",
"title": "Notifications",
- "close": "Close"
+ "close": "Close",
+ "dismiss_all": "Dismiss all"
},
"notification_toast": {
"service_call_failed": "Failed to call service {service}.",