social-pushover | add tags parameter (#846)

* social-pushover: Add "tags" parameter.

Add "tags" for emergency prio (2) messages, so you're able to cancel them by tag. (see doc / Pushover API)

* Add msg.tags to readme.
This commit is contained in:
Trise
2021-10-18 22:09:35 +02:00
committed by GitHub
parent 3e67ce628f
commit e6b9da52aa
4 changed files with 5 additions and 1 deletions

View File

@@ -42,6 +42,7 @@ module.exports = function(RED) {
var retry = msg.retry || 30;
var expire = msg.expire || 600;
var callback = msg.callback || null;
var tags = msg.tags || null;
if (isNaN(pri)) {pri=0;}
if (pri > 2) {pri = 2;}
if (pri < -2) {pri = -2;}
@@ -80,6 +81,7 @@ module.exports = function(RED) {
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 (typeof(tags) === 'string') { pushmsg.tags = tags; }
if (html) { pushmsg.html = 1; }
if (typeof(attachment) === 'string') {
// Treat attachment as a path