mirror of
https://github.com/Sebclem/OctoPrint-SimpleEmergencyStop.git
synced 2024-11-22 09:12:58 +01:00
Merge pull request #6 from CoolZeroNL/master
add support for multi gcode command splitted by ":" Thanks to CoolZeroNL
This commit is contained in:
commit
7d0bd5a0a0
@ -45,6 +45,15 @@ class SimpleemergencystopPlugin(octoprint.plugin.StartupPlugin,
|
|||||||
)
|
)
|
||||||
|
|
||||||
def on_api_command(self, command, data):
|
def on_api_command(self, command, data):
|
||||||
|
## check if there is a : in line
|
||||||
|
find_this = ":"
|
||||||
|
if find_this in str(self.emergencyGCODE):
|
||||||
|
|
||||||
|
# if : found then, split, then for each:
|
||||||
|
gcode_list = str(self.emergencyGCODE).split(':')
|
||||||
|
for gcode in gcode_list:
|
||||||
|
self._printer.commands(gcode)
|
||||||
|
else:
|
||||||
self._printer.commands(self.emergencyGCODE)
|
self._printer.commands(self.emergencyGCODE)
|
||||||
|
|
||||||
def get_assets(self):
|
def get_assets(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user