starting software configuration

This commit is contained in:
2019-02-09 09:41:21 +01:00
parent 3e60e872bf
commit 0d9723d784
5 changed files with 95 additions and 3 deletions
+2 -2
View File
@@ -15,8 +15,8 @@ logging.info('Initializing')
# Configuration
MUSIC_BASE_DIRECTORY = "mnt/NAS/"
SOUND_SCANNING = "mnt/INTERNAL/sounds/scanning.mp3"
SOUND_SCAN_FAIL = "mnt/INTERNAL/sounds/fail-05.mp3"
SOUND_SCANNING = "mnt/INTERNAL/qudio/sounds/scanning.mp3"
SOUND_SCAN_FAIL = "mnt/INTERNAL/qudio/sounds/fail-05.mp3"
QR_SCANNER_TIMEOUT = 4
# photo sensor on PIN 5
Binary file not shown.
+40
View File
@@ -0,0 +1,40 @@
from socketIO_client import SocketIO, LoggingNamespace
import threading
import time
is_playing = False # for toggling play/pause (stores the current status from the pushState events)
socketIO = SocketIO('localhost', 3000)
def play_callback(channel):
global is_playing
if is_playing:
logging.info("PAUSE")
socketIO.emit('pause')
else:
logging.info("PLAY")
socketIO.emit('play')
def events_thread():
socketIO.wait()
try:
socketIO.on('pushState', on_pushState)
socketIO.emit('replaceAndPlay', {'service':'mpd','uri':'mnt/INTERNAL/qudio/sounds/armstrong.mp3'})
time.sleep(3.5)
t1 = threading.Thread(target=play_callback)
t1.start()
t1.join()
time.sleep(3)
t1 = threading.Thread(target=play_callback)
t1.start()
t1.join()
# Exit when Ctrl-C is pressed
except KeyboardInterrupt:
logging.info('Shutdown')