Social: pushover; add callback parameter w/ documentation (#832)

* adding callback parameter to pushover node.

* pushover: callback feature added

* social/pushover documentation

* PR: added callback parameter to pushover
This commit is contained in:
brianmangan 2021-08-30 04:10:07 -07:00 committed by GitHub
parent 96fa500ad6
commit 6ca70977d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions

View File

@ -86,6 +86,7 @@
<p><code>msg.sound</code>: set the notification sound, <i><a href="https://pushover.net/api#sounds" target="_new">see the available options</a></i></p>
<p><code>msg.retry</code>: set retry interval for Emergency priority (2) messages, <i><a href="https://pushover.net/api#priority" target="_new">see details</a></i></p>
<p><code>msg.expire</code>: set retry duration for Emergency priority (2) messages, <i><a href="https://pushover.net/api#priority" target="_new">see details</a></i></p>
<p><code>msg.callback</code>: set the callback url for Emergency priority (2) messages, <i><a href="https://pushover.net/api/receipts#callback" target="_new">see details</a></i></p>
<p>Uses Pushover. See <i><a href="https://pushover.net" target="_new">this link</a></i> for more details.</p>
</script>

View File

@ -41,6 +41,7 @@ module.exports = function(RED) {
var attachment = msg.attachment || null;
var retry = msg.retry || 30;
var expire = msg.expire || 600;
var callback = msg.callback || null;
if (isNaN(pri)) {pri=0;}
if (pri > 2) {pri = 2;}
if (pri < -2) {pri = -2;}
@ -78,6 +79,7 @@ module.exports = function(RED) {
if (typeof(sound) === 'string') { pushmsg.sound = sound; }
if (typeof(url) === 'string') { pushmsg.url = url; }
if (typeof(url_title) === 'string') { pushmsg.url_title = url_title; }
if (typeof(callback) === 'string') { pushmsg.callback = callback; }
if (html) { pushmsg.html = 1; }
if (typeof(attachment) === 'string') {
// Treat attachment as a path

View File

@ -28,6 +28,7 @@ Optionally uses `msg.topic` to set the configuration, if not already set in the
- `msg.sound`: to set the alert sound, see the [available options](https://pushover.net/api#sounds)
- `msg.retry`: to set retry interval for Emergency priority (2) messages, see [priority](https://pushover.net/api#priority)
- `msg.expire`: to set retry duration for Emergency priority (2) messages, see [priority](https://pushover.net/api#priority)
- `msg.callback`: to set callback url for Emergency priority (2) messages, see [callback](https://pushover.net/api/receipts#callback)
The User-key and API-token are stored in a separate credentials file.