IndigoDomotics / indigo-pushover

Indigo plugin to send push notifications via Pushover.
MIT License
17 stars 11 forks source link

added the ability to attach an image to a pushover notification #21

Closed mlamoure closed 6 years ago

mlamoure commented 6 years ago
jcs commented 6 years ago

It would probably be better to just use requests for both types. Define files as an empty dictionary, then set "attachment" in it if it's not empty in msgAttachment.

It would also be good to print the result of the request to the debug log like the other one is doing with self.debugLog(r.text).

Also, if the image is more than 2.5Mb, the request will fail, so it might be good to check the size of the image file passed first and just not include it if it's too big so that the notification text isn't lost for what might be a critical event.

mlamoure commented 6 years ago

That makes sense. I've added those items and run some tests myself.