Skip to content

Instantly share code, notes, and snippets.

@jneilliii
Created March 22, 2024 18:57
Show Gist options
  • Save jneilliii/b6206ffa48a52e2904d551d9c1484567 to your computer and use it in GitHub Desktop.
Save jneilliii/b6206ffa48a52e2904d551d9c1484567 to your computer and use it in GitHub Desktop.
# coding=utf-8
import octoprint.plugin
import re
class PrusaXLTempFixPlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.RestartNeedingPlugin):
def __init__(self):
self.prusa_regex = re.compile(r"C:-30.00/0.00 ")
def gcode_callback(self, comm, line, *args, **kwargs):
if not self.prusa_regex.match(line):
return line
line = self.prusa_regex.sub('', line)
return line
__plugin_name__ = "Prusa XL Temp Fix"
__plugin_pythoncompat__ = ">=3,<4"
__plugin_version__ = "0.1.0"
__plugin_implementation__ = PrusaXLTempFixPlugin()
__plugin_hooks__ = {
"octoprint.comm.protocol.gcode.received": __plugin_implementation__.gcode_callback
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment