-
-
Save foosel/39cc61552fb6dbec222f075a6fece855 to your computer and use it in GitHub Desktop.
Turns broken temperature responses of the form "echo: T:28.7 /0.0 B:28.6 /0.0ok" into proper "ok T:28.7 /0.0 B:28.6 /0.0" ones.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
import logging | |
def fix_temperature_responses(comm, line, *args, **kwargs): | |
if "T" not in line or not line.startswith("echo:") or not line.endswith("ok"): | |
return line | |
return "ok {}".format(line[len("echo:"):-len("ok")]) | |
__plugin_name__ = "Fix Lerdge 3D temperature responses" | |
__plugin_hooks__ = { | |
"octoprint.comm.protocol.gcode.received": fix_temperature_responses | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment