Skip to content

Commit

Permalink
fix bug with M150 command not having I parameter causing the comman…
Browse files Browse the repository at this point in the history
…d to get lost in the queue, #143.
  • Loading branch information
jneilliii committed Apr 18, 2021
1 parent bcdb277 commit 66d3085
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions octoprint_tasmota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ def processGCODE(self, comm_instance, phase, cmd, cmd_type, gcode, *args, **kwar
else:
return
elif gcode == "M150":
plugip = None
workleds = dict(LEDRed=0, LEDBlue=0, LEDGreen=0, LEDWhite=0, LEDBrightness=-1)
workval = cmd.upper().split()
for i in workval:
Expand All @@ -746,9 +747,10 @@ def processGCODE(self, comm_instance, phase, cmd, cmd_type, gcode, *args, **kwar
else:
self._tasmota_logger.debug(leddata)

t = threading.Timer(0, self.gcode_led, [plugip, workleds])
t.daemon = True
t.start()
if plugip is not None:
t = threading.Timer(0, self.gcode_led, [plugip, workleds])
t.daemon = True
t.start()
elif self.powerOffWhenIdle and not (gcode in self._idleIgnoreCommandsArray):
self._waitForHeaters = False
self._reset_idle_timer()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "OctoPrint-Tasmota"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.0.3"
plugin_version = "1.0.4rc1"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit 66d3085

Please sign in to comment.