Solaar/lib/logitech_receiver
Ken Sanislo 2a3b8bbeaa Refactor G522 RGB to match keyboard/mouse LED Control pattern
Replaces the ad-hoc HeadsetRGBHostMode / HeadsetRGBColor pair with three
settings that mirror Solaar's existing RGB UX for keyboards and mice:

  HeadsetLEDControl        — Device/Solaar dropdown (ChoicesValidator,
                             same style as LEDControl / RGBControl).
  HeadsetLEDsPrimary       — gtk color picker via HeteroValidator, one
                             Static effect with a single COLOR field.
                             Writes apply to all discovered zones, then
                             re-apply per-zone overrides on top.
  HeadsetPerZoneLighting   — Settings + ChoicesMapValidator (mirrors
                             PerKeyLighting syntax, labeled "Per-zone"
                             since the firmware/spec uses "zone"). Uses
                             COLORSPLUS so "No change" inherits the
                             Primary color.

Adds lib/logitech_receiver/headset_rgb.py with two reusable helpers:

  discover_zones(device)         — one-shot zone enumeration run at
                                   setting build time, briefly claiming
                                   Solaar host mode and restoring the
                                   prior state; cached on the device.
  write_zone_map(device, map)    — shared write path that groups zones
                                   by final color, emits one
                                   SetRgbZonesSingleValue per unique
                                   color, then FrameEnd(0x01) to
                                   commit.

Any future RGB headset presenting 0x0620 picks up these settings
automatically — the new module is feature-keyed, not G522-specific.

Drops the stale logivoice.py import block (missing blank line between
stdlib and typing imports) that failed ruff's isort check in CI.
2026-04-19 14:16:49 -07:00
..
__init__.py
…
advanced_para_eq.py Audit diagnostic logging added during G522 bring-up 2026-04-19 13:13:44 -07:00
base.py Tighten Centurion probe and silence FeaturesArray query spam 2026-04-16 22:46:10 -07:00
base_usb.py
…
centurion.py Fix FeatureNotSupported crash on pending CenturionReceiver 2026-04-16 09:35:57 -07:00
centurion_constants.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
common.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
descriptors.py Add G522 LIGHTSPEED headset support (Centurion 0x50 transport variant) 2026-04-14 10:52:08 -07:00
desktop_notifications.py
…
device.py Audit diagnostic logging added during G522 bring-up 2026-04-19 13:13:44 -07:00
diversion.py
…
exceptions.py Use double quotes for module level docstrings 2024-06-02 09:54:21 -04:00
headset_rgb.py Refactor G522 RGB to match keyboard/mouse LED Control pattern 2026-04-19 14:16:49 -07:00
hidpp10.py
…
hidpp10_constants.py
…
hidpp20.py Audit diagnostic logging added during G522 bring-up 2026-04-19 13:13:44 -07:00
hidpp20_constants.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
i18n.py
…
listener.py Add G522 LIGHTSPEED headset support (Centurion 0x50 transport variant) 2026-04-14 10:52:08 -07:00
logivoice.py Refactor G522 RGB to match keyboard/mouse LED Control pattern 2026-04-19 14:16:49 -07:00
notifications.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
onboard_eq.py Remove references to internal RE docs and lghub_agent from code comments 2026-04-19 12:57:34 -07:00
receiver.py
…
settings.py Don't misreport empty-ACK writes as failed (Setting.write) 2026-04-17 19:49:20 -07:00
settings_new.py
…
settings_templates.py Refactor G522 RGB to match keyboard/mouse LED Control pattern 2026-04-19 14:16:49 -07:00
settings_validator.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
special_keys.py
…