changes to run configuration and virtual command model

This commit is contained in:
Tobias Kurze
2020-08-13 09:00:54 +02:00
parent 9c19708381
commit c8a517ff60
10 changed files with 75 additions and 33 deletions

View File

@@ -21,17 +21,17 @@ class WebSocketBase:
self.flask_app_context = app
self.socket_thread = None
def start_websocket_in_thread(self, host=None, port=None, debug=None):
def start_websocket_in_thread(self, host=None, port=None, debug=None, **kwargs):
self.socket_thread = threading.Thread(
target=self.start_websocket,
args=(host, port, debug))
args=(host, port, debug, kwargs))
self.socket_thread.start()
return self.socket_thread
def start_websocket(self, host=None, port=None, debug=None):
def start_websocket(self, host=None, port=None, debug=None, **kwargs):
if debug is None:
debug = self.flask_app_context.debug
socketio.run(self.flask_app_context, host=host, port=port, debug=debug)
socketio.run(self.flask_app_context, host=host, port=port, debug=debug, **kwargs)
def send_test_msg(self):
socketio.emit('test', "tolle nachricht")