Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions social/pushover/57-pushover.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 2 additions & 0 deletions social/pushover/57-pushover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions social/pushover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down