node-red / node-red-nodes

Extra nodes for Node-RED
Other
988 stars 593 forks source link

node-red-node-pushover support for attachment_base64 and attachment_type #1066

Open freman opened 4 months ago

freman commented 4 months ago

Hey, so, node-red-node-pushover has been working brilliantly but I've had a change of workflow that includes sending the images that I was previously attaching as base64. I tried a couple of different ways of passing it to the node before I went poking around the source and I don't think it supports it.

Could we please have support for attachment_base64 and attachment_type (https://pushover.net/api#attachments-base64)?

kerwitz commented 1 month ago

The Pushover node supports buffers in msg.attachment, so you can provide a base64 encoded image like this if you have it in a string:

msg.attachment = Buffer.from(msg.payload.picture, 'base64')
return msg

Put this into a function node before the pushover node and you should be golden.