Skip to content

Commit bee2be2

Browse files
Lexonight1claude
andcommitted
v4.2.5: fix LED style mismatch for PM=49 (LF10 product, LF8 layout)
resolve_style_id() name lookup matched style 7 (116 LEDs) instead of style 5 (93 LEDs) because PM=49's product name is "LF10" but its LED layout is style 5 ("LF8"). Now stores style_id from HID probe directly on DeviceInfo — no reverse name lookup needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1f9e63d commit bee2be2

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "trcc-linux"
7-
version = "4.2.4"
7+
version = "4.2.5"
88
description = "Linux implementation of Thermalright LCD Control Center"
99
readme = "README.md"
1010
license = "GPL-3.0-or-later"

src/trcc/__version__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""TRCC Linux version information."""
22

3-
__version__ = "4.2.4"
3+
__version__ = "4.2.5"
44
__version_info__ = tuple(int(x) for x in __version__.split("."))
55

66
# Version history:
@@ -155,3 +155,7 @@
155155
# resolution via handshake. Fixes HID devices like Assassin Spirit
156156
# 120 Vision ARGB (PM=36, 240x240) getting wrong-sized frames.
157157
# CLI commands also handshake before sending. 2308 tests.
158+
# 4.2.5 - Fix LED style mismatch for PM=49 (LF10 product, LF8 layout):
159+
# resolve_style_id() name lookup matched style 7 (116 LEDs) instead
160+
# of style 5 (93 LEDs). Now stores style_id from probe directly on
161+
# DeviceInfo — no reverse name lookup. 2308 tests.

src/trcc/adapters/device/scsi.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ def find_lcd_devices() -> List[Dict]:
252252

253253
model = dev.model
254254
button_image = dev.button_image
255+
led_style_id = None
255256

256257
# All LED devices share PID 0x8001 — probe via HID handshake
257258
# to discover the real model (AX120, PA120, LC1, etc.).
@@ -262,6 +263,7 @@ def find_lcd_devices() -> List[Dict]:
262263
usb_path=dev.usb_path)
263264
if info and info.model_name:
264265
model = info.model_name
266+
led_style_id = info.style.style_id if info.style else None
265267
btn = PmRegistry.get_button_image(info.pm, info.sub_type)
266268
if btn:
267269
button_image = btn
@@ -275,6 +277,7 @@ def find_lcd_devices() -> List[Dict]:
275277
'vendor': dev.vendor_name,
276278
'product': dev.product_name,
277279
'model': model,
280+
'led_style_id': led_style_id,
278281
'button_image': button_image,
279282
'vid': dev.vid,
280283
'pid': dev.pid,

src/trcc/core/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ class DeviceInfo:
169169
protocol: str = "scsi" # "scsi" or "hid"
170170
device_type: int = 1 # 1=SCSI, 2=HID Type 2 ("H"), 3=HID Type 3 ("ALi")
171171
implementation: str = "generic" # e.g. "thermalright_lcd_v1", "hid_type2", "hid_led"
172+
led_style_id: Optional[int] = None # LED style from probe (avoids name-based lookup)
172173

173174
# State
174175
connected: bool = True

src/trcc/qt_components/qt_app_mvc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,7 @@ def _on_device_widget_clicked(self, device_info: dict):
10211021
protocol=device_info.get('protocol', 'scsi'),
10221022
device_type=device_info.get('device_type', 1),
10231023
implementation=implementation,
1024+
led_style_id=device_info.get('led_style_id'),
10241025
)
10251026

10261027
if implementation == 'hid_led':
@@ -1725,7 +1726,9 @@ def _show_led_view(self, device: DeviceInfo):
17251726

17261727
from ..services.led import LEDService
17271728
model = device.model or ''
1728-
led_style = LEDService.resolve_style_id(model)
1729+
# Use probe-resolved style_id directly (avoids name collision:
1730+
# PM=49 "LF10" shares style 5 with "LF8", but name lookup hits style 7)
1731+
led_style = device.led_style_id or LEDService.resolve_style_id(model)
17291732

17301733
# Initialize controller for this device
17311734
self._led_controller.initialize(device, led_style)
@@ -2072,6 +2075,7 @@ def _on_device_poll(self):
20722075
protocol=d.get('protocol', 'scsi'),
20732076
device_type=d.get('device_type', 1),
20742077
implementation=implementation,
2078+
led_style_id=d.get('led_style_id'),
20752079
)
20762080
if implementation == 'hid_led':
20772081
self._show_led_view(device)

0 commit comments

Comments
 (0)