Skip to content

Commit

Permalink
Avoid errors on temperature_received without setpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
RoboMagus authored Oct 18, 2024
1 parent 6ac8469 commit 38114f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions octoprint_preheathelper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ def on_temperatures_received(self, comm_instance, parsed_temperatures, *args, **
last_tool_setpoint = self._last_tool_temp_setpoint
if parsed_temperatures.get("B"):
bed_target = parsed_temperatures.get("B")[-1]
if bed_target >= MINIMAL_SETPOINT_TEMPERATURE:
if bed_target and bed_target >= MINIMAL_SETPOINT_TEMPERATURE:
self._last_bed_temp_setpoint = bed_target

if parsed_temperatures.get("T0"):
tool_target = parsed_temperatures.get("T0")[-1]
if tool_target >= MINIMAL_SETPOINT_TEMPERATURE:
if tool_target and tool_target >= MINIMAL_SETPOINT_TEMPERATURE:
self._last_tool_temp_setpoint = tool_target

if last_bed_setpoint != self._last_bed_temp_setpoint or last_tool_setpoint != self._last_tool_temp_setpoint:
Expand Down

0 comments on commit 38114f3

Please sign in to comment.