From 1557f53e1cee578df9acb3564c8cba8c9a2071aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=CC=81=20Ko=CC=88cher?= Date: Wed, 23 Dec 2015 11:11:04 +0100 Subject: [PATCH 1/2] Add support for pushover sound selection. --- social/pushover/57-pushover.html | 4 ++-- social/pushover/57-pushover.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/social/pushover/57-pushover.html b/social/pushover/57-pushover.html index 17deb3e0..5ba1bd3e 100644 --- a/social/pushover/57-pushover.html +++ b/social/pushover/57-pushover.html @@ -47,8 +47,8 @@ diff --git a/social/pushover/57-pushover.js b/social/pushover/57-pushover.js index 9778e3fc..bf0a227c 100644 --- a/social/pushover/57-pushover.js +++ b/social/pushover/57-pushover.js @@ -45,6 +45,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 = msg.sound || null; if (isNaN(pri)) {pri=0;} if (pri > 2) {pri = 2;} if (pri < -2) {pri = -2;} @@ -61,6 +62,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); } From f5ae0d2c75c527ecea8d015e5f351ba83c64e323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=CC=81=20Ko=CC=88cher?= Date: Wed, 23 Dec 2015 13:42:22 +0100 Subject: [PATCH 2/2] Add available sounds to config view. --- social/pushover/57-pushover.html | 34 ++++++++++++++++++++++++++++++-- social/pushover/57-pushover.js | 4 +++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/social/pushover/57-pushover.html b/social/pushover/57-pushover.html index 5ba1bd3e..0aab7bd3 100644 --- a/social/pushover/57-pushover.html +++ b/social/pushover/57-pushover.html @@ -27,6 +27,34 @@ +
+ + +
@@ -42,7 +70,8 @@
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.