From 6ca70977d8081e9116b95e37162ce73db97bf0bd Mon Sep 17 00:00:00 2001 From: brianmangan Date: Mon, 30 Aug 2021 04:10:07 -0700 Subject: [PATCH] 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 --- social/pushover/57-pushover.html | 1 + social/pushover/57-pushover.js | 2 ++ social/pushover/README.md | 1 + 3 files changed, 4 insertions(+) diff --git a/social/pushover/57-pushover.html b/social/pushover/57-pushover.html index 942f2285..66d29bbc 100644 --- a/social/pushover/57-pushover.html +++ b/social/pushover/57-pushover.html @@ -86,6 +86,7 @@

msg.sound: set the notification sound, see the available options

msg.retry: set retry interval for Emergency priority (2) messages, see details

msg.expire: set retry duration for Emergency priority (2) messages, see details

+

msg.callback: set the callback url for Emergency priority (2) messages, see details

Uses Pushover. See this link for more details.

diff --git a/social/pushover/57-pushover.js b/social/pushover/57-pushover.js index 2a197712..548c58fd 100644 --- a/social/pushover/57-pushover.js +++ b/social/pushover/57-pushover.js @@ -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 diff --git a/social/pushover/README.md b/social/pushover/README.md index 55acef20..ce524e49 100644 --- a/social/pushover/README.md +++ b/social/pushover/README.md @@ -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.