From f96f69514ea28666db80df5c678e42aa0ad36455 Mon Sep 17 00:00:00 2001 From: guoge Date: Thu, 18 Jan 2024 17:58:58 +0800 Subject: [PATCH] add RESTART parameter for SAVE_CONFIG command. default is 1(restart klipper), 0 is not restart. --- klippy/configfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/klippy/configfile.py b/klippy/configfile.py index dd32d47fd3c6..0c0717d6cb4b 100644 --- a/klippy/configfile.py +++ b/klippy/configfile.py @@ -419,5 +419,9 @@ def cmd_SAVE_CONFIG(self, gcmd): msg = "Unable to write config file during SAVE_CONFIG" logging.exception(msg) raise gcode.error(msg) + restartflag = gcmd.get_int('RESTART', 1) + logging.info("Restart flag: %d", restartflag) + if restartflag == 0: + return # Request a restart gcode.request_restart('restart')