Skip to content

Commit cf8764a

Browse files
committed
black
1 parent ab621fe commit cf8764a

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

BLE_Client_Server/client/code.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,23 @@
2323

2424
pixels = NeoPixel(NEOPIXEL, 1) # Set up built-in NeoPixel
2525

26-
AQUA = const(0x00FFFF) # (0, 255, 255)
27-
GREEN = const(0x00FF00) # (0, 255, 0)
26+
AQUA = const(0x00FFFF) # (0, 255, 255)
27+
GREEN = const(0x00FF00) # (0, 255, 0)
2828
ORANGE = const(0xFF8000) # (255, 128, 0)
29-
RED = const(0xFF0000) # (255, 0, 0)
30-
BLUE = const(0x0000FF) # (0, 0, 255)
29+
RED = const(0xFF0000) # (255, 0, 0)
30+
BLUE = const(0x0000FF) # (0, 0, 255)
3131

32-
gradients = {'Off': [(0.0, RED), (0.75, ORANGE)],
33-
'On': [(0.0, GREEN), (1.0, AQUA)]}
34-
palette = fancy.expand_gradient(gradients['Off'], 30)
32+
gradients = {"Off": [(0.0, RED), (0.75, ORANGE)], "On": [(0.0, GREEN), (1.0, AQUA)]}
33+
palette = fancy.expand_gradient(gradients["Off"], 30)
3534

3635
gamma_levels = (0.25, 0.3, 0.15)
3736
color_index = 1
3837
fade_direction = 1
3938

40-
TARGET = 'f0:74:72:60:87:d2' # CHANGE TO YOUR BLE ADDRESS
39+
TARGET = "f0:74:72:60:87:d2" # CHANGE TO YOUR BLE ADDRESS
4140
target_address = TARGET.split(":") # Convert address string to list of bytes
4241
target_address.reverse() # Reverse bytes to match Address class little-endian
43-
target_address = unhexlify(''.join(target_address)) # Convert list to bytes
42+
target_address = unhexlify("".join(target_address)) # Convert list to bytes
4443

4544
button_packet = ButtonPacket("1", True) # Transmits pressed button 1
4645

@@ -80,10 +79,10 @@
8079
# Color match
8180
if fancy.CRGB(*packet.color).pack() == GREEN:
8281
# Green indicates on state
83-
palette = fancy.expand_gradient(gradients['On'], 30)
82+
palette = fancy.expand_gradient(gradients["On"], 30)
8483
else:
8584
# Otherwise red indicates off
86-
palette = fancy.expand_gradient(gradients['Off'], 30)
85+
palette = fancy.expand_gradient(gradients["Off"], 30)
8786

8887
# NeoPixel color fading routing
8988
color = fancy.palette_lookup(palette, color_index / 29)

0 commit comments

Comments
 (0)