Solaar/tests/logitech_receiver
Ken Sanislo 4d1f9dc6c1 rgb_control: honor the off state — don't auto-claim, init, or shutdown LEDs
PerKeyLighting.write was force-claiming SW control via rgb_control.write(True)
through _ensure_sw_control whenever a saved per-key map was applied. On
startup with rgb_control persisted as False, the apply path would re-enable
LED Control and overwrite the persister with True — making "off" impossible
to keep across restarts.

The fix treats rgb_control as the single gate for LED activity: when it's
off, Solaar performs no SW claim, no per-key/zone wire writes, no SW release
on apply (we never claimed), no profile-management restoration, and no
shutdown-animation trigger on exit. This lets another tool (OpenRGB etc.)
drive the LEDs without Solaar fighting it.

Settings that don't actively change current lighting are still allowed:
NV-config writes for startup/shutdown animations, brightness control (its
own feature, no color push), and persister updates for per-key/zone state
so colors survive an off→on toggle.

UI: _apply_rgb_gates already greys per-key/zone/idle/sleep rows when
rgb_control is off. Fix a race where the async-read completion callback in
_update_setting_item would re-set sensitivity from the user lock-icon flag
alone and undo the grey-out if rgb_control's read happened to complete
first. Extract _gate_blocks as the single source of truth and AND-combine
it into _update_setting_item's set_sensitive call.
2026-05-15 10:45:27 -04:00
..
__init__.py tests: Add tests of common module 2024-02-18 06:10:53 -05:00
fake_hidpp.py Add RGB lighting persistence and software LED power management for G515 2026-05-13 19:03:44 -04:00
test_base.py base: fix sw_id at 0x0B instead of rotating 0x2..0xF (#3218) 2026-05-14 15:08:56 -04:00
test_base_usb.py Speedup lookup of known receivers 2025-01-01 11:33:07 -05:00
test_common.py ui: Show offline status for receiver-paired device batteries (#3217) 2026-05-13 17:32:03 -04:00
test_desktop_notifications.py testing: upgrade desktop notifications tests to take notifications availability into account 2025-01-02 10:47:53 -05:00
test_device.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
test_diversion.py Refactor: Introduce Feature enum 2024-10-14 07:28:09 -04:00
test_hidpp10.py device: Handle composite IntFlag.name on Python < 3.11 (#3187) 2026-04-16 11:38:25 -04:00
test_hidpp20_complex.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
test_hidpp20_simple.py device: Fix operator precedence bug and end-of-configuration timing in device.changed() (#3173) 2026-05-13 11:30:26 -04:00
test_notifications.py show better pairing errors (#3063) 2025-12-10 11:18:50 -05:00
test_receiver.py device: Support per-slot unpair on Lightspeed receivers (CLI + GUI) (#3183) 2026-04-17 09:34:58 -04:00
test_rgb_power.py rgb_control: honor the off state — don't auto-claim, init, or shutdown LEDs 2026-05-15 10:45:27 -04:00
test_setting_templates.py Add RGB lighting persistence and software LED power management for G515 2026-05-13 19:03:44 -04:00
test_settings_validator.py common: render RGB color values as 0xrrggbb in config and solaar show 2026-05-12 12:51:36 -04:00