klippy_apis: send events on pause, resume, and cancel requests

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-03-11 16:51:23 -05:00
parent 7c1d6a8f24
commit 071a430159
No known key found for this signature in database
GPG Key ID: 7027245FBBDDF59A
1 changed files with 3 additions and 0 deletions

View File

@ -62,12 +62,15 @@ class KlippyAPI(Subscribable):
"/printer/firmware_restart", ['POST'], self._gcode_firmware_restart)
async def _gcode_pause(self, web_request: WebRequest) -> str:
self.server.send_event("klippy_apis:pause_requested")
return await self._send_klippy_request("pause_resume/pause", {})
async def _gcode_resume(self, web_request: WebRequest) -> str:
self.server.send_event("klippy_apis:resume_requested")
return await self._send_klippy_request("pause_resume/resume", {})
async def _gcode_cancel(self, web_request: WebRequest) -> str:
self.server.send_event("klippy_apis:cancel_requested")
return await self._send_klippy_request("pause_resume/cancel", {})
async def _gcode_start_print(self, web_request: WebRequest) -> str: