diff --git a/moonraker/websockets.py b/moonraker/websockets.py index 3f88c91..aa4740f 100644 --- a/moonraker/websockets.py +++ b/moonraker/websockets.py @@ -170,6 +170,8 @@ class WebsocketManager: self.rpc.register_method("server.websocket.id", self._handle_id_request) # Register events + self.server.register_event_handler( + "server:klippy_ready", self._handle_klippy_ready) self.server.register_event_handler( "server:klippy_disconnect", self._handle_klippy_disconnect) self.server.register_event_handler( @@ -181,6 +183,9 @@ class WebsocketManager: self.server.register_event_handler( "gpio_power:power_changed", self._handle_power_changed) + async def _handle_klippy_ready(self): + await self.notify_websockets("klippy_ready") + async def _handle_klippy_disconnect(self): await self.notify_websockets("klippy_disconnected")