Solaar/lib
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
..
hid_parser Fix warnings from automatic code inspections 2024-10-11 07:42:38 -04:00
hidapi Add G522 LIGHTSPEED headset support (Centurion 0x50 transport variant) 2026-04-14 10:52:08 -07:00
keysyms keysymdef: Rename key symbols 2024-10-11 07:42:38 -04:00
logitech_receiver Refactor G522 RGB to match keyboard/mouse LED Control pattern 2026-04-19 14:16:49 -07:00
solaar Fix G522 0x50 Centurion init failure and protocol version crash 2026-04-15 23:00:45 -07:00