Solaar/lib/logitech_receiver
Ken Sanislo 4cc8ac0d46 Record Centurion sub-device feature versions + version-gate AutoSleep
The Centurion sub-device discovery ignored the type/version bytes in
the per-index getFeatureId response and defaulted every feature's
version to 0. That made version-gated settings (sidetone, auto-sleep)
send V0 payload formats on features that may actually be V2/V3/V4 —
which the G522 rejects with OUT_OF_RANGE (error 0x03).

Evidence from tester's log (version acfd02ab):
  bridge sub-device error: orig_feat_idx=13 orig_func=0x1B error=0x03
  bridge sub-device error: orig_feat_idx=20 orig_func=0x1F error=0x03

feat_idx 13 is HeadsetAudioSidetone (0x0604); 20 is CenturionAutoSleep
(0x0108). Both have version-gated payload formats per the protocol doc.

Fixes:
1. In _discover_sub_device_features, extract response[3] (type) and
   response[4] (version) and store them in self.version / self.flags,
   so get_feature_version() returns the real version for downstream
   callers.

2. Add HeadsetAutoSleep.build() that picks byte_count and max_value
   based on the reported version (V<3=1 byte, V=3=2 bytes, V>=4=3).
   HeadsetSidetone.build() already had version gating — it just wasn't
   getting the real version before.

Does NOT address the mic-mute (error 0x0A) and mic-gain (error 0x0B)
rejections — those are non-standard error codes likely meaning the G522
either gates those behind the physical mic button (mic-mute) or rejects
writes for other reasons (mic-gain). Needs separate investigation once
the simpler version fix lands.
2026-04-17 23:51:34 -07:00
..
__init__.py Refactor: Distinguish module from package 2024-09-15 09:18:51 -04:00
advanced_para_eq.py Add read-only HeadsetAdvancedEQ (0x020D) display 2026-04-17 17:44:33 -07:00
base.py Tighten Centurion probe and silence FeaturesArray query spam 2026-04-16 22:46:10 -07:00
base_usb.py cli: allow to change LED settings 2025-12-21 18:03:53 -05:00
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 testing: upgrade desktop notifications tests to take notifications availability into account 2025-01-02 10:47:53 -05:00
device.py Log bridge sub-device error responses at INFO, not DEBUG 2026-04-17 21:08:55 -07:00
diversion.py rules: remove use of XTest and use uinput in all cases 2026-03-08 20:58:43 -04:00
exceptions.py Use double quotes for module level docstrings 2024-06-02 09:54:21 -04:00
hidpp10.py cli: Fix crash when showing notification flags. (#3070) 2025-12-12 04:54:10 -05:00
hidpp10_constants.py device: Fix crash in NotificationFlag.flag_names when flags is None (#3185) 2026-04-13 12:46:43 -04:00
hidpp20.py Record Centurion sub-device feature versions + version-gate AutoSleep 2026-04-17 23:51:34 -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 Unify imports in logitech package 2024-05-23 16:42:18 -04:00
listener.py Add G522 LIGHTSPEED headset support (Centurion 0x50 transport variant) 2026-04-14 10:52:08 -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 centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
receiver.py udev: correctly re-raise access exception 2025-10-17 19:41:23 -04:00
settings.py Don't misreport empty-ACK writes as failed (Setting.write) 2026-04-17 19:49:20 -07:00
settings_new.py settings: add setting for HAPTIC feature 2025-11-12 14:50:46 -05:00
settings_templates.py Record Centurion sub-device feature versions + version-gate AutoSleep 2026-04-17 23:51:34 -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 device: add special keys from Logitech 2025-10-16 20:57:15 -04:00