diff --git a/webinterface.py b/webinterface.py index 9ea48e7..005ec10 100644 --- a/webinterface.py +++ b/webinterface.py @@ -2,8 +2,19 @@ from bottle import route, get, static_file, run from bottle.ext.websocket import GeventWebSocketServer from bottle.ext.websocket import websocket from os.path import join as pathjoin +from statemachine import DialingState import threading +class WebDialingState(DialingState): + def __init__(self, controller): + super().__init__(controller) + + def on_nummernschalter_input(self, num): + print("calling super method") + super().on_nummernschalter_input(num) + print("local method got num: " + str(num)) + + class FeTapWeb(): def __init__(self, config, statemachine_controller): self.config = config @@ -19,6 +30,9 @@ class FeTapWeb(): return "

Hello world!

" def publish_status(self): + if isinstance(self.controller.state, DialingState): + self.controller.state = WebDialingState(self.controller) + print("dialing") for ws in self.websockets: ws.send("this is a message triggered from the server") return "ok"