diff --git a/Pushover.indigoPlugin/Contents/Info.plist b/Pushover.indigoPlugin/Contents/Info.plist index 72283b6..4de5d96 100644 --- a/Pushover.indigoPlugin/Contents/Info.plist +++ b/Pushover.indigoPlugin/Contents/Info.plist @@ -3,7 +3,7 @@ PluginVersion - 1.5.0 + 1.5.1 ServerApiVersion 2.0 IwsApiVersion diff --git a/Pushover.indigoPlugin/Contents/Server Plugin/plugin.py b/Pushover.indigoPlugin/Contents/Server Plugin/plugin.py index 0b59a21..62afe8f 100644 --- a/Pushover.indigoPlugin/Contents/Server Plugin/plugin.py +++ b/Pushover.indigoPlugin/Contents/Server Plugin/plugin.py @@ -89,9 +89,9 @@ def send(self, pluginAction): if self.present(pluginAction.props.get('msgAttachment')): attachFile = self.prepareTextValue(pluginAction.props['msgAttachment']) - extension = os.path.splitext(attachFile)[1] + extension = os.path.splitext(attachFile.lower())[1] - if os.path.isfile(attachFile) and (extension == '.jpg' or extension == '.jpeg' or extension == '.gif'): + if os.path.isfile(attachFile) and (extension in ['.jpg', '.jpeg', '.gif']): if os.path.getsize(attachFile) <= 2621440: attachment = { "attachment": (attachFile, open(attachFile, "rb"), "image/jpeg") @@ -99,7 +99,7 @@ def send(self, pluginAction): else: self.logger.warn(u"Warning: attached file size was too large, attachment was skipped") else: - self.logger.warn(u"Warning: file does not exist, or is not a jpeg file, attachment was skipped") + self.logger.warn(u"Warning: file does not exist, or is not an image file, attachment was skipped") if self.present(pluginAction.props.get('msgPriority')): params['priority'] = pluginAction.props['msgPriority'] @@ -116,7 +116,7 @@ def send(self, pluginAction): self.debugLog(u"Result: %s" % r.text) if r.status_code == 200: - self.logger.info(u"Pushover announcement was sent sucessfully, title: " + msgTitle + ", body: " + msgBody) + self.logger.info(u"Pushover notification was sent sucessfully, title: " + msgTitle + ", body: " + msgBody) else: self.logger.error(u"Result: %s" % r.text)