1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 1 deletions

View File

@ -87,6 +87,7 @@
<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><code>msg.tags</code>: set tags for Emergency priority (2) messages, <i><a href="https://pushover.net/api/receipts#cancel_by_tag" 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>

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

View File

@ -29,6 +29,7 @@ Optionally uses `msg.topic` to set the configuration, if not already set in the
- `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)
- `msg.tags`: to set tags for Emergency priority (2) messages, see [tags](https://pushover.net/api/receipts#cancel_by_tag)
The User-key and API-token are stored in a separate credentials file.

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-pushover",
"version" : "0.1.0",
"version" : "0.1.1",
"description" : "A Node-RED node to send alerts via Pushover",
"dependencies" : {
"pushover-notifications" : "^1.2.2"