From 7aa578e2dd167a0bdfb77ba4bb1a82245e792f82 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Wed, 8 Feb 2023 18:02:56 +0100 Subject: [PATCH] Fix creating a color packet with an int --- adafruit_bluefruit_connect/color_packet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_bluefruit_connect/color_packet.py b/adafruit_bluefruit_connect/color_packet.py index 9056d84..9524813 100644 --- a/adafruit_bluefruit_connect/color_packet.py +++ b/adafruit_bluefruit_connect/color_packet.py @@ -34,7 +34,7 @@ def __init__(self, color): or an int color value ``0xRRGGBB`` """ if isinstance(color, int): - self._color = tuple(color.to_bytes("BBB", "big")) + self._color = tuple(color.to_bytes(3, "big")) elif len(color) == 3 and all(0 <= c <= 255 for c in color): self._color = color else: