Skip to content

Commit 3e73708

Browse files
committed
Fixing UpdateLEDS packet size issue
1 parent ab74afc commit 3e73708

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
@@ -214,7 +214,7 @@ def _set_device_color(self, color: utils.RGBColor, fast: bool = False):
214214
struct.calcsize(f"IH{3*(len(self.leds))}b{len(self.leds)}x")
215215
)
216216
buff = struct.pack("H", len(self.leds)) + (color.pack())*len(self.leds)
217-
buff = struct.pack("I", len(buff)) + buff
217+
buff = struct.pack("I", len(buff) + struct.calcsize("I")) + buff
218218
self.comms.send_data(buff)
219219
if not fast:
220220
self.update()
@@ -235,7 +235,7 @@ def _set_device_colors(self, colors: list[utils.RGBColor], fast: bool = False):
235235
)
236236
buff = struct.pack("H", len(self.leds)) + \
237237
b''.join((color.pack() for color in colors))
238-
buff = struct.pack("I", len(buff)) + buff
238+
buff = struct.pack("I", len(buff) + struct.calcsize("I")) + buff
239239
self.comms.send_data(buff)
240240
if not fast:
241241
self.update()

0 commit comments

Comments
 (0)