Skip to content

Commit c13a2bf

Browse files
committed
updated/fixed led zone grouping
1 parent d511541 commit c13a2bf

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

openrgb/utils.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -429,19 +429,11 @@ def unpack(cls, data: bytearray, start: int = 0) -> CDT:
429429
start, zones = parse_list(ZoneData, data, start)
430430
start, leds = parse_list(LEDData, data, start)
431431
start, colors = parse_list(RGBColor, data, start)
432+
i = 0
432433
for zone in zones:
433-
zone.leds = []
434-
zone.colors = []
435-
for x, led in enumerate(leds):
436-
if zone.name in led.name:
437-
zone.leds.append(led)
438-
zone.colors.append(colors[x])
439-
elif device_type == DeviceType.DEVICE_TYPE_KEYBOARD \
440-
and zone.zone_type == ZoneType.ZONE_TYPE_MATRIX \
441-
and led.name.lower().startswith("key"):
442-
zone.leds.append(led)
443-
zone.colors.append(colors[x])
444-
434+
zone.leds = leds[i:i + zone.num_leds]
435+
zone.colors = colors[i:i + zone.num_leds]
436+
i += zone.num_leds
445437
# print("Device Information:\n", "\tDevice type:", device_type, "\n\t", end="")
446438
# print(metadata, sep="\n\t")
447439
# print("Mode Information:\n", "\tNumber of modes:", len(modes), "\n\tActive Mode:", active_mode, "\n\t", end="")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="openrgb-python",
8-
version='0.1.0',
8+
version='0.1.1',
99
author="jath03",
1010
description="A python client for the OpenRGB SDK",
1111
long_description=long_description,

0 commit comments

Comments
 (0)