Skip to content

Commit

Permalink
no title error
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingDiver committed Apr 19, 2019
1 parent f55df01 commit 663e65b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Pushover.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>1.5.1</string>
<string>1.5.2</string>
<key>ServerApiVersion</key>
<string>2.0</string>
<key>IwsApiVersion</key>
Expand Down
8 changes: 5 additions & 3 deletions Pushover.indigoPlugin/Contents/Server Plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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):

Expand Down

0 comments on commit 663e65b

Please sign in to comment.