So I am trying to listen for a state change via a small hacked together python program. When I run, the initial state comes back alright, but then as soon as I attempt to do anything other than pause via the WebUI I get multiple outputs.
Code:
1 from socketIO_client import SocketIO
2
3 socketIO = SocketIO('localhost', 3000)
4
5 def statusInfo(*args):
6 print(args[0]['status'].encode('ascii', 'ignore'))
7 def on_connect(*args):
8 print('Connected')
9 # Listen for connect
10 socketIO.on('connect', on_connect)
11 # Listen for pushState
12 socketIO.on('pushState', statusInfo)
13 # Get initial state
14 socketIO.emit('getState', '', statusInfo)
15 socketIO.wait()
Output:
Connected #Initial connection, expected
pause #Initial state, expected
play #Play via WebUI, expected
play #Duplicate play, unexpected
pause #Pause via WebUI, expected
stop #Next via WebUI, (stop?) unexpected.
stop #Duplicate (and multiple) stop, unexpected
stop
stop
stop
stop
stop
play #Play after Next, semi-expected
play #Duplicate (multiple) play, unexpected
play
pause #Pause, expected
Does anyone know what is going on?