Skip to content

Commit 89bc921

Browse files
authored
Fix more "UpdateZoneLEDs packet has invalid size" errors (#75)
1 parent 02144b6 commit 89bc921

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openrgb/orgb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def set_color(self, color: utils.RGBColor, fast: bool = False):
122122
)
123123
buff = struct.pack("iH", self.id, len(self.leds)) + \
124124
(color.pack())*len(self.leds)
125-
buff = struct.pack("I", len(buff)) + buff
125+
buff = struct.pack("I", len(buff) + struct.calcsize("I")) + buff
126126
self.comms.send_data(buff)
127127
if not fast:
128128
self.update()
@@ -144,7 +144,7 @@ def set_colors(self, colors: list[utils.RGBColor], fast: bool = False):
144144
)
145145
buff = struct.pack("iH", self.id, len(self.leds)) + \
146146
b''.join((color.pack() for color in colors))
147-
buff = struct.pack("I", len(buff)) + buff
147+
buff = struct.pack("I", len(buff) + struct.calcsize("I")) + buff
148148
self.comms.send_data(buff)
149149
if not fast:
150150
self.update()

0 commit comments

Comments
 (0)