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 <ayufan@ayufan.eu>
This commit is contained in:
Kamil Trzcinski 2021-06-15 08:34:30 +00:00 committed by Eric Callahan
parent 3b4bfba85e
commit 20673b9edd
1 changed files with 3 additions and 3 deletions

View File

@ -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')