diff --git a/social/pushover/57-pushover.html b/social/pushover/57-pushover.html index 17deb3e0..0aab7bd3 100644 --- a/social/pushover/57-pushover.html +++ b/social/pushover/57-pushover.html @@ -27,6 +27,34 @@ +
+ + +
@@ -42,13 +70,14 @@
Tip: Leave title blank to set using msg.topic.
Leave device blank to send to all devices, or to set using msg.device.
- Leave priority blank to set using msg.priority. Supports priorities 2, 1, 0, -1, and -2.
+ Leave priority blank to set using msg.priority. Supports priorities 2, 1, 0, -1, and -2.
+ Leave sound blank to use the default, or set using msg.sound. @@ -60,7 +89,8 @@ name: {value:""}, device: {value:""}, title: {value:""}, - priority: {value:0} + priority: {value:0}, + sound: {value:""} }, credentials: { deviceid: {type:"text"}, diff --git a/social/pushover/57-pushover.js b/social/pushover/57-pushover.js index 9778e3fc..867daf12 100644 --- a/social/pushover/57-pushover.js +++ b/social/pushover/57-pushover.js @@ -24,6 +24,8 @@ module.exports = function(RED) { this.title = n.title; this.device = n.device; this.priority = n.priority; + this.sound = n.sound; + if (this.sound === '') { this.sound = null; } var credentials = this.credentials; if ((credentials) && (credentials.hasOwnProperty("pushkey"))) { this.pushkey = credentials.pushkey; } else { this.error("No Pushover api token set"); } @@ -45,6 +47,7 @@ module.exports = function(RED) { var titl = this.title || msg.topic || "Node-RED"; var pri = this.priority || msg.priority || 0; var dev = this.device || msg.device; + var sound = this.sound || msg.sound || null; if (isNaN(pri)) {pri=0;} if (pri > 2) {pri = 2;} if (pri < -2) {pri = -2;} @@ -61,6 +64,7 @@ module.exports = function(RED) { expire: 600 }; if (dev) { pushmsg.device = dev; } + if (typeof(sound) === 'string') { pushmsg.sound = sound; } //node.log("Sending "+JSON.stringify(pushmsg)); pusher.send( pushmsg, function(err, response) { if (err) { node.error("Pushover Error: "+err); }