Skip to content

Commit 824a8f5

Browse files
authored
[jsscripting] Add example how to hide notifications again (openhab#17978)
* Added example now to hide notifications again Signed-off-by: Eric Bodden <[email protected]>
1 parent 2e82fe6 commit 824a8f5

File tree

1 file changed

+7
-0
lines changed
  • bundles/org.openhab.automation.jsscripting

1 file changed

+7
-0
lines changed

bundles/org.openhab.automation.jsscripting/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,13 @@ actions.notificationBuilder('Hello World!').logOnly().send();
800800
// Sends a simple log notification with icon and tag
801801
actions.notificationBuilder('Hello World!').logOnly()
802802
.withIcon('f7:bell_fill').withTag('important').send();
803+
804+
// Sends a notification about a temperature change ...
805+
actions.notificationBuilder('new temperature: xyz').withIcon('oh:temperature').withTag('Temperature change').withReferenceId('livingRoom').send();
806+
// ... and hides it again after 10 minutes
807+
setTimeout(() => {
808+
actions.notificationBuilder().hide().withReferenceId('livingRoom').send();
809+
}, 10 * 60 * 1000);
803810
```
804811
805812
See [openhab-js : actions.NotificationBuilder](https://openhab.github.io/openhab-js/actions.html#.notificationBuilder) for complete documentation.

0 commit comments

Comments
 (0)