mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-12-26 23:16:47 +01:00
let pushover take an attachment object
This commit is contained in:
@@ -118,10 +118,13 @@ module.exports = function(RED) {
|
||||
// Unset these temporary values
|
||||
attachmentBuffer = attachmentString = undefined;
|
||||
// attach the buffer
|
||||
pushmsg.file = { data: attachment };
|
||||
pushmsg.file = { data:attachment };
|
||||
}
|
||||
else if (typeof(msg.attachment) === 'object' && msg.attachment.hasOwnProperty('name') && msg.attachment.hasOwnProperty('data')) {
|
||||
pushmsg.file = msg.attachment;
|
||||
}
|
||||
else if (attachment) {
|
||||
node.error("[57-pushover.js] Error: attachment property must be a path to a local file or a Buffer containing an image");
|
||||
node.error("[57-pushover.js] Error: attachment property must be a path to a local file or a Buffer containing an image, or an object containing both name and data properties");
|
||||
return;
|
||||
}
|
||||
pushMessage(pushmsg,msg);
|
||||
|
||||
@@ -21,7 +21,7 @@ Optionally uses `msg.topic` to set the configuration, if not already set in the
|
||||
- `msg.device`: to set the device
|
||||
- `msg.priority`: to set the priority
|
||||
- `msg.topic`: to set the title
|
||||
- `msg.attachment`: to specify an image to attach to message (path as a string or Buffer containing image)
|
||||
- `msg.attachment`: to specify an image to attach to message. Either as a path as a string, or Buffer containing image as either binary or base64 encoded, or an object containing "name" and "data" properties.
|
||||
- `msg.url`: to add a web address
|
||||
- `msg.url_title`: to add a url title
|
||||
- `msg.html`: set to true or 1 if message is HTML formatted, see the [supported tags](https://pushover.net/api#html)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red-node-pushover",
|
||||
"version": "0.2.2",
|
||||
"version": "0.3.0",
|
||||
"description": "A Node-RED node to send alerts via Pushover",
|
||||
"dependencies": {
|
||||
"pushover-notifications": "^1.2.3"
|
||||
|
||||
Reference in New Issue
Block a user