Skip to content

Commit 08a9f69

Browse files
authored
Add example how to hide notifications again (#419)
Related to: openhab/openhab-addons#17978. Signed-off-by: lsiepel <[email protected]>
1 parent af47dd3 commit 08a9f69

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,13 @@ actions.notificationBuilder('Hello World!').logOnly().send();
855855
// Sends a simple log notification with icon and tag
856856
actions.notificationBuilder('Hello World!').logOnly()
857857
.withIcon('f7:bell_fill').withTag('important').send();
858+
859+
// Sends a notification about a temperature change ...
860+
actions.notificationBuilder('new temperature: xyz').withIcon('oh:temperature').withTag('Temperature change').withReferenceId('livingRoom').send();
861+
// ... and hides it again after 10 minutes
862+
setTimeout(() => {
863+
actions.notificationBuilder().hide().withReferenceId('livingRoom').send();
864+
}, 10 * 60 * 1000);
858865
```
859866
860867
See [openhab-js : actions.NotificationBuilder](https://openhab.github.io/openhab-js/actions.html#.notificationBuilder) for complete documentation.

0 commit comments

Comments
 (0)