websockets: add "klippy_shutdown" notification

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2021-01-01 11:48:31 -05:00
parent f753263c60
commit 7d738c7a8b
1 changed files with 5 additions and 0 deletions

View File

@ -172,6 +172,8 @@ class WebsocketManager:
# Register events
self.server.register_event_handler(
"server:klippy_ready", self._handle_klippy_ready)
self.server.register_event_handler(
"server:klippy_shutdown", self._handle_klippy_shutdown)
self.server.register_event_handler(
"server:klippy_disconnect", self._handle_klippy_disconnect)
self.server.register_event_handler(
@ -188,6 +190,9 @@ class WebsocketManager:
async def _handle_klippy_ready(self):
await self.notify_websockets("klippy_ready")
async def _handle_klippy_shutdown(self):
await self.notify_websockets("klippy_shutdown")
async def _handle_klippy_disconnect(self):
await self.notify_websockets("klippy_disconnected")