From 20673b9eddcf681319086bc18fc1a56f2fe23dff Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 15 Jun 2021 08:34:30 +0000 Subject: [PATCH] pause_resume: Make Moonraker to use `pause_resume/*` API This switches Moonraker from calling `CANCEL_PRINT` and alikes to rather use `pause_resume/` API that underneath calls the relevant G-Codes. This done, this way, allows Klipper to be able to interrupt blocking operations gracefully. Signed-off-by: Kamil Trzcinski --- moonraker/components/klippy_apis.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moonraker/components/klippy_apis.py b/moonraker/components/klippy_apis.py index c136823..19bac81 100644 --- a/moonraker/components/klippy_apis.py +++ b/moonraker/components/klippy_apis.py @@ -60,13 +60,13 @@ class KlippyAPI(Subscribable): "/printer/firmware_restart", ['POST'], self._gcode_firmware_restart) async def _gcode_pause(self, web_request: WebRequest) -> str: - return await self.run_gcode("PAUSE") + return await self._send_klippy_request("pause_resume/pause", {}) async def _gcode_resume(self, web_request: WebRequest) -> str: - return await self.run_gcode("RESUME") + return await self._send_klippy_request("pause_resume/resume", {}) async def _gcode_cancel(self, web_request: WebRequest) -> str: - return await self.run_gcode("CANCEL_PRINT") + return await self._send_klippy_request("pause_resume/cancel", {}) async def _gcode_start_print(self, web_request: WebRequest) -> str: filename: str = web_request.get_str('filename')