Playing Now Gizmo better stability
@@ -98,13 +98,16 @@ while True:
group.append(border)
while radio.connected:
- try:
for connection in radio.connections:
+ try:
if not connection.paired:
connection.pair()
print("paired")
ams = connection[AppleMediaService]
+ except (RuntimeError, UnsupportedCommand, AttributeError):
+ # Skip Bad Packets, unknown commands, etc.
+ continue
set_label(title_label, ams.title, 18)
set_label(album_label, ams.album, 21)
set_label(artist_label, ams.artist, 21)
@@ -124,9 +127,6 @@ while True:
else:
ams.next_track()
time.sleep(0.1)
- except (RuntimeError, UnsupportedCommand):
- # Skip Bad Packets, unknown commands, etc.
- pass
print("disconnected")
# Remove all layers
