IndigoDomotics / indigo-pushover

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

No notification are sent because API requests are made with an empty user parameter #17

Closed drbrain closed 6 years ago

drbrain commented 6 years ago

In send the plugin fills in some params including the user value from the plugin configuration box

Then the plugin overwrites the user with the msgUser option if it is not None

configure send pushover notification 2018-02-13 11-51-11

If you do not fill in the "User:" field the value that the plugin checks is not None, it appears to be an empty string ("").

For the above dialog, the request body contains:

request: sound=pushover&title=test&url=&priority=0&token=MY_TOKEN&user=&device=&message=test&url_title=

This results in the following response:

$ curl -XPOST -d 'sound=pushover&title=test&url=&priority=0&token=MY_TOKEN&user=&device=&message=test&url_title=' https://api.pushover.net/1/messages
{"user":"invalid","errors":["user identifier is not a valid user, group, or subscribed user key"],"status":0,"request":"d961e780-b6fa-4d6f-bcde-63df63437c96"}

I won't have time to create a proper pull request for a while, but changing the condition on L54 of plugin.py to != "" sends messages with my user token using the above notification.

drbrain commented 6 years ago

This occurs with both the latest release, 1.2.0 and master.