mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-31 13:34:22 +02:00
[jsscripting] Add example how to hide notifications again (#17978)
* Added example now to hide notifications again Signed-off-by: Eric Bodden <eric.bodden@upb.de>
This commit is contained in:
@@ -800,6 +800,13 @@ actions.notificationBuilder('Hello World!').logOnly().send();
|
||||
// Sends a simple log notification with icon and tag
|
||||
actions.notificationBuilder('Hello World!').logOnly()
|
||||
.withIcon('f7:bell_fill').withTag('important').send();
|
||||
|
||||
// Sends a notification about a temperature change ...
|
||||
actions.notificationBuilder('new temperature: xyz').withIcon('oh:temperature').withTag('Temperature change').withReferenceId('livingRoom').send();
|
||||
// ... and hides it again after 10 minutes
|
||||
setTimeout(() => {
|
||||
actions.notificationBuilder().hide().withReferenceId('livingRoom').send();
|
||||
}, 10 * 60 * 1000);
|
||||
```
|
||||
|
||||
See [openhab-js : actions.NotificationBuilder](https://openhab.github.io/openhab-js/actions.html#.notificationBuilder) for complete documentation.
|
||||
|
||||
Reference in New Issue
Block a user