Skip to content

Commit c96ddeb

Browse files
committed
Handle UnsupportedCommand
1 parent 274242c commit c96ddeb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

CPB_AMS_Gizmo_BLE/cpb_ams_gizmo_ble.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
import adafruit_ble
1414
from adafruit_ble.advertising.standard import SolicitServicesAdvertisement
1515
from adafruit_ble_apple_media import AppleMediaService
16+
from adafruit_ble_apple_media import UnsupportedCommand
1617
from adafruit_circuitplayground import cp
1718

18-
BACKGROUND_COLOR = 0x49523b # Gray
19-
TEXT_COLOR = 0xFF0000 # Red
20-
BORDER_COLOR = 0xAAAAAA # Light Gray
19+
BACKGROUND_COLOR = 0x49523b # Gray
20+
TEXT_COLOR = 0xFF0000 # Red
21+
BORDER_COLOR = 0xAAAAAA # Light Gray
2122
STATUS_COLOR = BORDER_COLOR
2223

2324
# PyLint can't find BLERadio for some reason so special case it here.
@@ -123,7 +124,7 @@ def set_status(label, action_text, player):
123124
else:
124125
ams.next_track()
125126
time.sleep(0.1)
126-
except RuntimeError:
127+
except (RuntimeError, UnsupportedCommand):
127128
# Skip Bad Packets, unknown commands, etc.
128129
pass
129130

0 commit comments

Comments
 (0)