OctoPrint-Slack icon indicating copy to clipboard operation
OctoPrint-Slack copied to clipboard

Support Octoprint 1.4.0

Open weactivist opened this issue 4 years ago • 2 comments

Since 1.4.0 has been released the plugin does not work anymore.

The reason for this:

Deprecated since version 1.3.0: file: the file’s full path on disk (local) or within its storage (sdcard). To be removed in 1.4.0.

filename: the file’s name. To be removed in 1.4.0.

https://docs.octoprint.org/en/master/events/#printing

2020-04-30 12:33:57,932 - octoprint.plugin - ERROR - Error while calling plugin slack Traceback (most recent call last): File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/__init__.py", line 224, in call_plugin result = getattr(plugin, method)(*args, **kwargs) File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_slack/__init__.py", line 98, in on_event filename = os.path.basename(payload["file"]) KeyError: 'file'

Change https://github.com/richjoyce/OctoPrint-Slack/blob/4aafb81c405d02321221031fcd44d7565686becd/octoprint_slack/init.py#L98

To: filename = payload["name"]

weactivist avatar Apr 30 '20 10:04 weactivist

Thanks a lot @weactivist

BabyOnMove avatar May 01 '20 09:05 BabyOnMove

Thanks for opening this issue @weactivist, I just could not figure out why I could not get it right! Hopefully it gets fixed real soon.

JBisschoff avatar May 15 '20 03:05 JBisschoff