You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[pushover] Add support for Expiring Messages (openhab#15289)
* Add support for Expiring Messages
* Add action variants with TTL parameter
Resolvesopenhab#15288
---------
Signed-off-by: Jacob Laursen <[email protected]>
Copy file name to clipboardexpand all lines: bundles/org.openhab.binding.pushover/README.md
+39-1
Original file line number
Diff line number
Diff line change
@@ -40,20 +40,34 @@ The parameter `message` is **mandatory**, the `title` parameter defaults to what
40
40
Parameters declared as `@Nullable` are not optional.
41
41
One has to pass a `null` value if it should be skipped or the default value for it should be used.
42
42
43
-
-`sendMessage(String message, @Nullable String title, @Nullable String sound, @Nullable String url, @Nullable String urlTitle, @Nullable String attachment, @Nullable String contentType, @Nullable Integer priority, @Nullable String device)` - This method is used to send a plain text message providing all available parameters.
43
+
-`sendMessage(String message, @Nullable String title, @Nullable String sound, @Nullable String url, @Nullable String urlTitle, @Nullable String attachment, @Nullable String contentType, @Nullable Integer priority, @Nullable String device, @Nullable Duration ttl)` - This method is used to send a plain text message providing all available parameters.
44
+
45
+
-`sendMessage(String message)` - This method is used to send a plain text message with default title.
44
46
45
47
-`sendMessage(String message, @Nullable String title)` - This method is used to send a plain text message.
46
48
49
+
-`sendMessage(String message, @Nullable String title, @Nullable Duration ttl)` - This method is used to send a plain text message with TTL.
50
+
47
51
-`sendHtmlMessage(String message, @Nullable String title)` - This method is used to send a HTML message.
48
52
53
+
-`sendHtmlMessage(String message, @Nullable String title, @Nullable Duration ttl)` - This method is used to send a HTML message with TTL.
54
+
49
55
-`sendMonospaceMessage(String message, @Nullable String title)` - This method is used to send a monospace message.
50
56
57
+
-`sendMonospaceMessage(String message, @Nullable String title, @Nullable Duration ttl)` - This method is used to send a monospace message with TTL.
58
+
51
59
-`sendAttachmentMessage(String message, @Nullable String title, String attachment, @Nullable String contentType)` - This method is used to send a message with an attachment. It takes a local path or URL to the attachment (parameter `attachment`**mandatory**). Additionally you can pass a data URI scheme to this parameter. Optionally pass a `contentType` to define the content-type of the attachment (default: `image/jpeg` or guessed from image data).
52
60
61
+
-`sendAttachmentMessage(String message, @Nullable String title, String attachment, @Nullable String contentType, @Nullable Duration ttl)` - This method is used to send a message with an attachment and TTL. See previous method for details.
62
+
53
63
-`sendURLMessage(String message, @Nullable String title, String url, @Nullable String urlTitle)` - This method is used to send a message with an URL. A supplementary `url` to show with the message and a `urlTitle` for the URL, otherwise just the URL is shown.
54
64
65
+
-`sendURLMessage(String message, @Nullable String title, String url, @Nullable String urlTitle, @Nullable Duration ttl)` - This method is used to send a message with an URL and TTL. See previous method for details.
66
+
55
67
-`sendMessageToDevice(String device, String message, @Nullable String title)` - This method is used to send a message to a specific device. Parameter `device`**mandatory** is the name of a specific device (multiple devices may be separated by a comma).
56
68
69
+
-`sendMessageToDevice(String device, String message, @Nullable String title, @Nullable Duration ttl)` - This method is used to send a message to a specific device with TTL. See previous method for details.
70
+
57
71
-`sendPriorityMessage(String message, @Nullable String title, @Nullable Integer priority)` - This method is used to send a priority message.
58
72
Parameter `priority` is the priority to be used (`-2` = lowest priority, `-1` = low priority, `0` = normal priority, `1` = high priority, `2` = emergency priority; default: `2`).
59
73
For priority `2` only, the action returns a `String` value (the `receipt`) if the message was sent successfully, otherwise `null`.
@@ -100,3 +114,27 @@ if( receipt !== null ) {
100
114
receipt =null
101
115
}
102
116
```
117
+
118
+
:::: tabs
119
+
120
+
::: tab DSL
121
+
122
+
```java
123
+
val actions = getActions("pushover", "pushover:pushover-account:account")
124
+
// send expiring message
125
+
actions.sendMessage("Boost has been activated", "Recuperator", Duration.ofHours(1))
126
+
```
127
+
128
+
:::
129
+
130
+
::: tab JavaScript
131
+
132
+
```javascript
133
+
var pushoverActions =actions.thingActions('pushover', 'pushover:pushover-account:account');
134
+
// send expiring message
135
+
pushoverActions.sendMessage("Boost has been activated", "Recuperator", time.Duration.ofHours(1));
0 commit comments