websockets: Add "update_refreshed" notification

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2021-01-04 07:05:54 -05:00
parent 5b9f637c2d
commit 0c280122fb
1 changed files with 5 additions and 0 deletions

View File

@ -186,6 +186,8 @@ class WebsocketManager:
"gpio_power:power_changed", self._handle_power_changed)
self.server.register_event_handler(
"update_manager:update_response", self._handle_update_response)
self.server.register_event_handler(
"update_manager:update_refreshed", self._handle_update_refreshed)
async def _handle_klippy_ready(self):
await self.notify_websockets("klippy_ready")
@ -211,6 +213,9 @@ class WebsocketManager:
async def _handle_update_response(self, response):
await self.notify_websockets("update_response", response)
async def _handle_update_refreshed(self, refresh_info):
await self.notify_websockets("update_refreshed", refresh_info)
def register_local_handler(self, api_def, callback):
for ws_method, req_method in \
zip(api_def.ws_methods, api_def.request_methods):