aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-08-11 21:35:56 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-08-16 13:23:16 -0400
commit2b0b30ccd5745a10230b29825e87dc3ff379d583 (patch)
tree7e7fe484b2af7bd0fee0007e45c08993fdc731ce
parent1ae671f61f1010cf49e08eeb01afb6fa283c68d1 (diff)
downloadkutter-2b0b30ccd5745a10230b29825e87dc3ff379d583.tar.gz
kutter-2b0b30ccd5745a10230b29825e87dc3ff379d583.tar.xz
kutter-2b0b30ccd5745a10230b29825e87dc3ff379d583.zip
webhooks: Remove call_remote_method()
Clients will now only receive messages that they've subscribed to. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/webhooks.py14
1 files changed, 1 insertions, 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):