Added example now to hide notifications again

Signed-off-by: Eric Bodden <eric.bodden@upb.de>
This commit is contained in:
Eric Bodden 2024-12-25 10:19:57 +01:00 committed by GitHub
parent 0e5e48f763
commit 730d32c3c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -800,6 +800,13 @@ actions.notificationBuilder('Hello World!').logOnly().send();
// Sends a simple log notification with icon and tag // Sends a simple log notification with icon and tag
actions.notificationBuilder('Hello World!').logOnly() actions.notificationBuilder('Hello World!').logOnly()
.withIcon('f7:bell_fill').withTag('important').send(); .withIcon('f7:bell_fill').withTag('important').send();
//sends a notification about a temperature change...
actions.notificationBuilder(str).withIcon("oh:temperature").withTag("Temperature change").withReferenceId("living room").send();
//and clears it again after 10 minutes
setTimeout(() => {
actions.notificationBuilder().withReferenceId("living room").hide().send();
}, 10 * 60 * 1000);
``` ```
See [openhab-js : actions.NotificationBuilder](https://openhab.github.io/openhab-js/actions.html#.notificationBuilder) for complete documentation. See [openhab-js : actions.NotificationBuilder](https://openhab.github.io/openhab-js/actions.html#.notificationBuilder) for complete documentation.