Solaar/tests/logitech_receiver
grechmarlon c26f3cd6ec Fix per-key state loss: invalid editor zones and power-cycle cookie skip
Three related fixes for per-key lighting state being lost on the wire:

1. The per-key canvas models layout gaps as placeholder cells with
   zone_id -1. Paint strokes sweeping a gap emitted -1 in the delta,
   which entered the setting's map, was persisted, and then aborted
   EVERY subsequent full-map repaint at frame pack time
   (OverflowError: can't convert negative int to unsigned) — the apply
   was logged and ignored, so keys silently kept stale colors or went
   dark. Filter gap cells from the delta before it reaches the sink.

2. PerKeyLighting now sanitizes zone keys against the device-reported
   zone bitmap in update/write/read paths, so an already-poisoned
   persisted map (saved by a build without fix 1) heals on read instead
   of permanently breaking repaints.

3. WIRELESS_DEVICE_STATUS power-on reconfig requests went through the
   ConfigChange-cookie dedup gate. On a G915 TKL the cookie survives a
   power cycle, so the gate concluded nothing changed and skipped
   apply_all_settings — but power-on wipes volatile state (RGB buffers,
   host-mode lighting), leaving the keyboard dark until manual
   intervention. A powered-on notification now forces the apply.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 20:18:38 +02:00
..
__init__.py tests: Add tests of common module 2024-02-18 06:10:53 -05:00
fake_hidpp.py centurion: Headset icon kind at construction (#3226) 2026-05-19 15:36:29 -04:00
test_base.py G522 LIGHTSPEED headphones support 2026-05-21 10:13:00 -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 tests: mock the libnotify backend so the suite raises no real notifications 2026-05-21 10:15:12 -04:00
test_device.py G522 LIGHTSPEED headphones support 2026-05-21 10:13:00 -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 G522 LIGHTSPEED headphones support 2026-05-21 10:13:00 -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 Fix per-key state loss: invalid editor zones and power-cycle cookie skip 2026-06-11 20:18:38 +02:00
test_setting_templates.py headset RGB: regression tests for _HeadsetOnboardEffect color seeding 2026-05-21 10:13:00 -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