diff --git a/social/pushover/57-pushover.html b/social/pushover/57-pushover.html index e3f9f130..8f641979 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.ttl: set time to live duration on anything except Emergency priority (2) messages, see details

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

msg.tags: set tags 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 98603a69..3a77bbd7 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 ttl = msg.ttl || null; var callback = msg.callback || null; var tags = msg.tags || null; if (isNaN(pri)) {pri=0;} @@ -62,6 +63,10 @@ module.exports = function(RED) { expire = 10800; node.warn("Expire time too high, using maximum setting of 10800s (3 hours) retry duration"); } + if (!Number.isInteger(ttl) || ttl<=0) { + ttl = null; + node.warn("No valid number for TTL found, not set"); + } if (typeof msg.payload === 'undefined') { msg.payload = "(undefined msg.payload)"; } if (typeof(msg.payload) === 'object') { msg.payload = JSON.stringify(msg.payload); @@ -74,6 +79,7 @@ module.exports = function(RED) { priority: pri, retry: retry, expire: expire, + ttl: ttl, html: html }; if (dev) { pushmsg.device = dev; }