From 2b0b30ccd5745a10230b29825e87dc3ff379d583 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 11 Aug 2020 21:35:56 -0400 Subject: [PATCH] webhooks: Remove call_remote_method() Clients will now only receive messages that they've subscribed to. Signed-off-by: Kevin O'Connor --- klippy/webhooks.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/klippy/webhooks.py b/klippy/webhooks.py index 352ee761..9a6fd16e 100644 --- a/klippy/webhooks.py +++ b/klippy/webhooks.py @@ -144,10 +144,6 @@ class ServerSocket: def pop_client(self, client_id): self.clients.pop(client_id, None) - def send_all_clients(self, data): - for client in self.clients.values(): - client.send(data) - class ClientConnection: def __init__(self, server, sock): self.printer = server.printer @@ -296,17 +292,9 @@ class WebHooks: raise WebRequestError(msg) return cb - def call_remote_method(self, method, **kwargs): - self.sconn.send_all_clients({'method': method, 'params': kwargs}) - - def _action_call_remote_method(self, method, **kwargs): - self.call_remote_method(method, **kwargs) - return "" - def get_status(self, eventtime): state_message, state = self.printer.get_state_message() - return {'state': state, 'state_message': state_message, - "action_call_remote_method": self._action_call_remote_method} + return {'state': state, 'state_message': state_message} class GCodeHelper: def __init__(self, printer):