bchanudet / OctoPrint-Octorant

Discord plugin for OctoPrint
MIT License
26 stars 14 forks source link

OctoPrint 1.4.0 - No notification on Start #38

Closed noxin1 closed 4 years ago

noxin1 commented 4 years ago

Not receiving notifications on Start after upgrading to 1.4.0 The Start message is : "🖨️ I've started printing {file}"

2020-03-15 04:03:02,884 - octoprint.plugins.detailedprogress - INFO - Printing started. Detailed progress started. 2020-03-15 04:03:02,897 - octoprint.plugin - ERROR - Error while calling plugin octorant 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_octorant/init.py", line 189, in on_event return self.notify_event("printing_started",payload) File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_octorant/init.py", line 252, in notify_event return self.send_message(eventID, tmpConfig["message"].format(data), tmpConfig["with_snapshot"]) KeyError: 'file'

bchanudet commented 4 years ago

Hello and thanks for your report!

Indeed the recent OctoPrint versions removed the {file} variable from the Plugin API. The new variable is now called {name}.

I fixed it for the the new installations in eebeb16572d67f8e5b9a89f7fe27805bd4e807cb, and to warn existing users, I also added in 4ce3cf7b13373e4ef6097c65fcd990106c153391 a warning in the text sent to Discord when such an error occurs.

All of this will be available in the next 1.2.3 version of the plugins, coming shortly :)