Skip to content

Commit cd8090b

Browse files
ksanisloclaude
andcommitted
Add RGB lighting persistence, software LED power management, and grab-immune input monitoring for G515/G502
Implements software LED idle/wake management when Solaar claims SW control of RGB effects, replacing firmware power management that gets disabled. Adds dual-channel activity monitoring via evdev and hidraw (immune to EVIOCGRAB) so LEDs stay lit during gaming. Handles device online/offline transitions to avoid conflicts when switching between wired and wireless connections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 310b3af commit cd8090b

6 files changed

Lines changed: 569 additions & 1 deletion

File tree

docs/devices/G502 X PLUS 4099.txt

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
Solaar version 1.1.19
2+
3+
2: G502 X PLUS
4+
Device path : None
5+
WPID : 4099
6+
Codename : G502 X PLUS
7+
Kind : mouse
8+
Protocol : HID++ 4.2
9+
Report Rate : 1ms
10+
Serial number:
11+
Model ID: 4099C0950000
12+
Unit ID:
13+
Bootloader: BL1 42.00.B0016
14+
Firmware: MPM 27.00.B0016
15+
The power switch is located on the unknown.
16+
Supports 32 HID++ 2.0 features:
17+
0: ROOT {0000} V0
18+
1: FEATURE SET {0001} V0
19+
2: DEVICE FW VERSION {0003} V4
20+
Firmware: Bootloader BL1 42.00.B0016
21+
Firmware: Firmware MPM 27.00.B0016
22+
Unit ID: Model ID: 4099C0950000 Transport IDs: {'wpid': '4099', 'usbid': 'C095'}
23+
3: DEVICE NAME {0005} V0
24+
Name: G502 X PLUS
25+
Kind: mouse
26+
4: WIRELESS DEVICE STATUS {1D4B} V0
27+
5: CONFIG CHANGE {0020} V0
28+
6: UNIFIED BATTERY {1004} V3
29+
7: ADJUSTABLE DPI {2201} V2
30+
Sensitivity (DPI) (saved): 1600
31+
8: HIRES WHEEL {2121} V0
32+
Multiplier: 8
33+
Has invert: Normal wheel motion
34+
Has ratchet switch: Normal wheel mode
35+
Low resolution mode
36+
HID notification
37+
Scroll Wheel Direction (saved): False
38+
Scroll Wheel Resolution (saved): False
39+
Scroll Wheel Diversion (saved): False
40+
9: RGB EFFECTS {8071} V2
41+
LED Control (saved): Solaar
42+
LED Idle Timeout (saved): 1 Minute
43+
LEDs Primary (saved): !LEDEffectSetting {ID: 1, color: 2531945, intensity: 0, period: 100, ramp: 0, speed: 0}
44+
10: PER KEY LIGHTING V2 {8081} V2
45+
Per-key Lighting (saved): {A:No change, B:No change, C:No change, D:No change, E:No change, F:No change, G:No change, H:No change}
46+
11: ONBOARD PROFILES {8100} V0
47+
Device Mode: On-Board
48+
Onboard Profiles (saved): Disabled
49+
12: MOUSE BUTTON SPY {8110} V0
50+
13: REPORT RATE {8060} V0
51+
Report Rate (saved): 1ms
52+
14: FORCE PAIRING {1500} V0
53+
15: DFU {00D0} V3
54+
16: DEVICE RESET {1802} V0
55+
17: unknown:1803 {0318} V0 internal, hidden, unknown:000010
56+
18: CONFIG DEVICE PROPS {1806} V8
57+
19: unknown:1811 {1118} V0 internal, hidden, unknown:000010
58+
20: OOBSTATE {1805} V0
59+
21: unknown:1830 {3018} V0 internal, hidden, unknown:000010
60+
22: unknown:1875 {7518} V0 internal, hidden, unknown:000010
61+
23: unknown:1861 {6118} V0 internal, hidden, unknown:000010
62+
24: unknown:1890 {9018} V0 internal, hidden, unknown:000008
63+
25: unknown:18A1 {A118} V0 internal, hidden, unknown:000010
64+
26: unknown:1801 {0118} V0 internal, hidden, unknown:000010
65+
27: unknown:1E00 {001E} V0 hidden
66+
28: unknown:1E22 {221E} V0 internal, hidden, unknown:000010
67+
29: unknown:1EB0 {B01E} V0 internal, hidden, unknown:000010
68+
30: unknown:18B1 {B118} V0 internal, hidden, unknown:000010
69+
31: unknown:18C0 {C018} V0 internal, hidden, unknown:000010
70+
Battery status unavailable.

lib/logitech_receiver/hidpp20_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ class SupportedFeature(IntEnum):
140140
PER_KEY_LIGHTING_V2 = 0x8081
141141
MODE_STATUS = 0x8090
142142
ONBOARD_PROFILES = 0x8100
143+
PROFILE_MANAGEMENT = 0x8101
143144
MOUSE_BUTTON_SPY = 0x8110
144145
LATENCY_MONITORING = 0x8111
145146
GAMING_ATTACHMENTS = 0x8120

lib/logitech_receiver/notifications.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,10 @@ def _process_feature_notification(device: Device, notification: HIDPPNotificatio
419419
brightness = struct.unpack("!H", device.feature_request(SupportedFeature.BRIGHTNESS_CONTROL, 0x10)[:2])[0]
420420
device.setting_callback(device, settings_templates.BrightnessControl, [brightness])
421421

422+
elif feature == SupportedFeature.RGB_EFFECTS:
423+
if logger.isEnabledFor(logging.DEBUG):
424+
logger.debug("%s: RGB_EFFECTS notification addr=%02x: %s", device, notification.address, notification)
425+
422426
diversion.process_notification(device, notification, feature)
423427
return True
424428

0 commit comments

Comments
 (0)