replace client-triggered state refresh with server-triggered
[ppt-control.git] / ppt_control / ppt_control_obs.py
index e36957eeaecf3e99a79ada9e5ba8b3314a80f7d3..aa2e44b7bb72e42a8f7634127404b0dae7102d0f 100755 (executable)
@@ -44,8 +44,9 @@ async def communicate():
         while True:\r
             if cmd:\r
                 try:\r
-                    await websocket.send('{"action": "%s"}' % cmd)\r
+                    cmd_temp = cmd\r
                     cmd = ""\r
+                    await websocket.send('{"action": "%s"}' % cmd_temp)\r
                 except websockets.ConnectionClosed as exc:\r
                     attempts += 1\r
                     if attempts == 4:\r