diff --git a/octoprint_klipper/__init__.py b/octoprint_klipper/__init__.py index 8c8acee..bf56602 100644 --- a/octoprint_klipper/__init__.py +++ b/octoprint_klipper/__init__.py @@ -175,10 +175,19 @@ class KlipperPlugin( f = open(configpath, "w") f.write(data["config"]) f.close() - # Restart klippy to reload config - self._printer.commands(self._settings.get( - ["configuration", "reload_command"])) - self.log_info("Reloading Klipper Configuration.") + #load the reload command from changed data if it is not existing load the saved setting + if self.key_exist(data, "configuration", "reload_command"): + reload_command = os.path.expanduser( + data["configuration"]["reload_command"] + ) + else: + reload_command = self._settings.get(["configuration", "reload_command"]) + + if reload_command != "manually": + # Restart klippy to reload config + self._printer.commands(reload_command) + self.log_info("Reloading Klipper Configuration.") + self.log_debug("Writing Klipper config to {}".format(configpath)) except IOError: self.log_error("Error: Couldn't write Klipper config file: {}".format(configpath)) diff --git a/octoprint_klipper/templates/klipper_settings.jinja2 b/octoprint_klipper/templates/klipper_settings.jinja2 index d6c68fc..b3696ac 100644 --- a/octoprint_klipper/templates/klipper_settings.jinja2 +++ b/octoprint_klipper/templates/klipper_settings.jinja2 @@ -50,9 +50,11 @@ - The command that is executed when the Klipper configuration changed and needs to be reloaded. + The command that is executed when the Klipper configuration changed and needs to be reloaded.
+ Set this to "Manually" if you don't want to immediately restart klipper.
diff --git a/setup.py b/setup.py index e0783f7..faef05d 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ plugin_package = "octoprint_klipper" plugin_name = "OctoKlipper" -plugin_version = "0.3.5" +plugin_version = "0.3.6" plugin_description = """A plugin for OctoPrint to configure,control and monitor the Klipper 3D printer software."""