Pushover Node Image Attachment Support
Hi Node-redders,
I’m keen to add image attachment support to the built in node-red pushover node. Handy to attach a picture from a security camera that detects motion for instance.
I'm preparing a PR for the pushover-notifications module that underpins node-red-node-pushover to implement the new v3 API image attachment feature.
It's a surprisingly simple enhancement, and I'm reasonably confident that the author will accept the PR. With this PR merged, adding this feature to node-red-node-pushover should be relatively straight-forward. I’m happy to implement this feature and issue a PR to the [node-red-nodes]repository containing the source.
So the purpose of this topic is to:
- consult with @knolleary, @dceejay and the broader NR community before proceeding with a PR for the pushover node as per accepted practice.
- garner input/advice from the broader community about how to implement the feature.
On point 1, I am aware that a contrib node exists([node-red-contrib-pushover]). Apart from the issue of largely duplicated functionality of a core node, there are two other problems. Firstly, it fails when you use it without an image attachment. Secondly it doesn’t support sending images stored as a Buffer within the NR msg object received. I see this as a common use case to the extent that someone else wrote a fork - [node-red-contrib-pushover-inline-image] which still suffers from the above problems rooted in its parent.
The following briefly outlines what I propose, but if there are better ideas, please share.
- Introduce an
attachment
msg property to provide an image for the message. This property name aligns with the pushover API - This property's value can be either a path to a local file expressed as a string or a Buffer object that holds the image itself to send
With this implementation, the node can, asynchronously, send a pushover message attaching an image from the filesystem. But it can also, synchronously, send a pushover message attaching an image from a Buffer object provided in the NR msg object.
Over to the community.
Cheers,
Damo.