Skip to content

Commit 6d3515f

Browse files
committed
🐛 Fix cooling tracking
Regression introduced by 86cf849
1 parent 0970666 commit 6d3515f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

octoprint_ws281x_led_status/__init__.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ class WS281xLedStatusPlugin(
6060
current_progress = 0 # type: int
6161

6262
current_heater_heating = None # type: str
63+
previous_target = {
64+
"tool": 0,
65+
"bed": 0,
66+
} # Store last non-zero target here, for cooling tracking
6367
tool_to_target = 0 # type: int
6468

6569
previous_event = "" # type: str # Effect here will be run when progress expires
@@ -534,6 +538,12 @@ def abort():
534538
# Find the bed target temperature from OctoPrint
535539
bed_target = self._printer.get_current_temperatures()["bed"]["target"]
536540

541+
if tool_target is not None and tool_target > 0:
542+
self.previous_target["tool"] = tool_target
543+
544+
if bed_target is not None and bed_target > 0:
545+
self.previous_target["bed"] = tool_target
546+
537547
if self.heating:
538548
# Find out current temperature from parsed
539549
if self.current_heater_heating == "tool":
@@ -576,10 +586,10 @@ def abort():
576586
heater = "T{}".format(
577587
self._settings.get(["effects", "progress_heatup", "tool_key"])
578588
)
579-
target = tool_target
589+
target = self.previous_target["tool"]
580590
else:
581591
heater = "B"
582-
target = bed_target
592+
target = self.previous_target["bed"]
583593

584594
try:
585595
current = parsed_temps[heater][0]

0 commit comments

Comments
 (0)