From c64c5e891c0d6014c0cfe6925d9c797b1afdbdb1 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 8 Oct 2025 14:03:33 -0400 Subject: [PATCH] virtual_sdcard: Move shutdown debugging to "klippy:analyze_shutdown" event Signed-off-by: Kevin O'Connor --- klippy/extras/virtual_sdcard.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py index b17004562..a2d6d0a0b 100644 --- a/klippy/extras/virtual_sdcard.py +++ b/klippy/extras/virtual_sdcard.py @@ -16,8 +16,6 @@ DEFAULT_ERROR_GCODE = """ class VirtualSD: def __init__(self, config): self.printer = config.get_printer() - self.printer.register_event_handler("klippy:shutdown", - self.handle_shutdown) # sdcard state sd = config.get('path') self.sdcard_dirname = os.path.normpath(os.path.expanduser(sd)) @@ -46,7 +44,9 @@ class VirtualSD: self.gcode.register_command( "SDCARD_PRINT_FILE", self.cmd_SDCARD_PRINT_FILE, desc=self.cmd_SDCARD_PRINT_FILE_help) - def handle_shutdown(self): + self.printer.register_event_handler("klippy:analyze_shutdown", + self._handle_analyze_shutdown) + def _handle_analyze_shutdown(self, msg, details): if self.work_timer is not None: self.must_pause_work = True try: