adafruit / Adafruit_CircuitPython_BluefruitConnect

This module helps you to communicate with the Adafruit Bluefruit Connect app or use its protocols
MIT License
17 stars 16 forks source link

Fix creating a color packet with an int #36

Closed Neradoc closed 1 year ago

Neradoc commented 1 year ago

Fixes creating a ColorPacket from an int (like rainbowio.colorwheel)

from adafruit_bluefruit_connect.color_packet import ColorPacket
c = ColorPacket(0xFF0080)
print(c.color)

Before:

code.py output:
Traceback (most recent call last):
  File "code.py", line 2, in <module>
  File "adafruit_bluefruit_connect/color_packet.py", line 37, in __init__
TypeError: can't convert str to int

After:

code.py output:
(255, 0, 128)