diff --git a/Pushover.indigoPlugin/Contents/Info.plist b/Pushover.indigoPlugin/Contents/Info.plist index 4de5d96..722d5ea 100644 --- a/Pushover.indigoPlugin/Contents/Info.plist +++ b/Pushover.indigoPlugin/Contents/Info.plist @@ -3,7 +3,7 @@ PluginVersion - 1.5.1 + 1.5.2 ServerApiVersion 2.0 IwsApiVersion diff --git a/Pushover.indigoPlugin/Contents/Server Plugin/plugin.py b/Pushover.indigoPlugin/Contents/Server Plugin/plugin.py index 62afe8f..44ca2fa 100644 --- a/Pushover.indigoPlugin/Contents/Server Plugin/plugin.py +++ b/Pushover.indigoPlugin/Contents/Server Plugin/plugin.py @@ -71,6 +71,9 @@ def send(self, pluginAction): if self.present(pluginAction.props.get('msgTitle')): msgTitle = self.prepareTextValue(pluginAction.props['msgTitle']).strip() params['title'] = msgTitle + else: + msgTitle = '' + if self.present(pluginAction.props.get('msgDevice')): params['device'] = pluginAction.props['msgDevice'].strip() @@ -113,12 +116,11 @@ def send(self, pluginAction): r = requests.post("https://api.pushover.net/1/messages.json", data = params, files = attachment) - self.debugLog(u"Result: %s" % r.text) - if r.status_code == 200: + self.debugLog(u"Result: %s" % r.text) self.logger.info(u"Pushover notification was sent sucessfully, title: " + msgTitle + ", body: " + msgBody) else: - self.logger.error(u"Result: %s" % r.text) + self.logger.error(u"Post Error - Result: %s" % r.text) def cancel(self, pluginAction):