From 297d101f5f7006cfdb104d5d46abaa0912abd6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 18 Nov 2013 11:35:38 +0100 Subject: [PATCH] Only apply the temperature offset if the temperature being set from the GCODE isn't 0 ("heaters off") --- src/octoprint/util/comm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index bcc05efb..78b913f8 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -1178,8 +1178,9 @@ class PrintingGcodeFileInformation(PrintingFileInformation): try: temp = float(tempMatch.group(2)) - newTemp = temp + offset - line = line.replace("S" + tempMatch.group(2), "S%f" % newTemp) + if temp > 0: + newTemp = temp + offset + line = line.replace("S" + tempMatch.group(2), "S%f" % newTemp) except ValueError: pass return line