From 119164e05c7ab829c9a9ce3a4bf9152a2d061d15 Mon Sep 17 00:00:00 2001 From: CoolZeroNL <26223744+CoolZeroNL@users.noreply.github.com> Date: Sun, 15 Oct 2017 23:28:28 +0200 Subject: [PATCH] Update __init__.py add support for multi gcode command splitted by : Sample Value: M140 S60 : M104 S220 T0 : M112 --- octoprint_simpleemergencystop/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/octoprint_simpleemergencystop/__init__.py b/octoprint_simpleemergencystop/__init__.py index e0662ee..bffeefc 100644 --- a/octoprint_simpleemergencystop/__init__.py +++ b/octoprint_simpleemergencystop/__init__.py @@ -45,7 +45,16 @@ class SimpleemergencystopPlugin(octoprint.plugin.StartupPlugin, ) def on_api_command(self, command, data): - self._printer.commands(self.emergencyGCODE) + ## 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) def get_assets(self):