IndigoDomotics / indigo-pushover

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

API key not received by script #36

Closed mvabase closed 1 year ago

mvabase commented 1 year ago

Hi,

Thanks for the plugin.

In Indigo 2022.1.2 and version 2022 of the plugin, it seems that the script does not receive the API key in line 22.

Upon installation the plugin cannot get the list of sounds (Error getting alert sounds list: 'sounds') and messages fail to send (Post Error - Result: {"token":"invalid","errors":["application token is invalid"],"status":0,"request":"5d183b1f-d2d9-4a55-aceb-cb6e28fb5e03"}). Also when leaving the API field empty the warning in line 24 is not raised)

I replaced line 22 with this and now it works:

self.apiToken = self.pluginPrefs['apiToken']

Less important: there is a typo in line 24 ("PI" instead of "API) ;-)

Thanks, Marc

FlyingDiver commented 1 year ago

I'm not sure how that could possibly work since at that point (line 22) there is no such thing as self.pluginPrefs.

I fixed the typo.

FlyingDiver commented 1 year ago

I tested the existing code again, and it works fine. I did just add validation to the config dialog to make sure an API token is entered.