From 6782aaccd7b6ab81e9082286991cc618911de5e0 Mon Sep 17 00:00:00 2001 From: tilman Date: Sun, 1 Sep 2024 16:29:40 +0000 Subject: [PATCH] volumio-control.py Pinbelegung --- code/volumio-control.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/code/volumio-control.py b/code/volumio-control.py index 4a0bd3e..1735b06 100644 --- a/code/volumio-control.py +++ b/code/volumio-control.py @@ -11,8 +11,9 @@ # # nano volumio-control.py # s.u. # +# # wait 25 seconds for the API to come online # sudo nano /etc/rc.local -# # su volumio -c 'sleep 20 && python3 /home/volumio/volumio-control.py >> /home/volumio/volumio-control.log 2>&1 &' +# # su volumio -c 'sleep 25 && python3 /home/volumio/volumio-control.py >> /home/volumio/volumio-control.log 2>&1 &' # # sudo reboot # @@ -31,10 +32,10 @@ sio.connect('http://localhost:3000') status = 'pause' def button_pressed(channel): - if channel == 11: - print('next') - sio.emit('next') - elif channel == 13: + if channel == 19: + print('prev') + sio.emit('prev') + elif channel == 21: # print('state', status) if status == 'play': print('pause') @@ -42,9 +43,9 @@ def button_pressed(channel): else: print('play') sio.emit('play') - elif channel == 15: - print('prev') - sio.emit('prev') + elif channel == 23: + print('next') + sio.emit('next') def setup_channel(channel): try: @@ -55,7 +56,7 @@ def setup_channel(channel): except (ValueError, RuntimeError) as e: print('ERROR:', e) -for x in [11, 13, 15]: +for x in [19, 21, 23]: setup_channel(x)