-bump for 0.3.6
-added option to turn off automatic restart after then klipper configuration changed
This commit is contained in:
parent
53e2ea5e02
commit
6629dc0bd4
|
@ -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))
|
||||
|
|
|
@ -50,9 +50,11 @@
|
|||
<select data-bind="value: settings.settings.plugins.klipper.configuration.reload_command">
|
||||
<option value="RESTART">RESTART</option>
|
||||
<option value="FIRMWARE_RESTART">FIRMWARE_RESTART</option>
|
||||
<option value="manually">Manually</option>
|
||||
</select>
|
||||
<span class="help-block">
|
||||
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.<br>
|
||||
Set this to "Manually" if you don't want to immediately restart klipper.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue