From 795bd03b336c34bb09b3dcf190da08d0fa430258 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 4 Aug 2020 16:03:20 -0400 Subject: [PATCH] webhooks: Directly invoke printer.invoke_shutdown() No need to indirectly shutdown via the gcode class - just call printer.invoke_shutdown() directly. Signed-off-by: Kevin O'Connor --- klippy/webhooks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/klippy/webhooks.py b/klippy/webhooks.py index 1c3645be..f6491187 100644 --- a/klippy/webhooks.py +++ b/klippy/webhooks.py @@ -255,8 +255,7 @@ class WebHooks: def _handle_estop_request(self, web_request): if web_request.get_method() != 'POST': raise web_request.error("Invalid Request Method") - gcode = self.printer.lookup_object('gcode') - gcode.cmd_M112(None) + self.printer.invoke_shutdown("Shutdown due to webhooks request") def get_connection(self): return self.sconn