From 96311f4eec66ef97dd416886736e3718c13d84b7 Mon Sep 17 00:00:00 2001 From: Ken Sanislo Date: Fri, 15 May 2026 21:07:47 -0700 Subject: [PATCH] centurion: seed child headset kind via pairing_info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The construction-time kind=headset seeding only covered the direct create_device path. G522-style devices reach a CenturionReceiver, whose notify_devices() builds the headset as a child Device with device_info=None and sets dev.centurion=True only after __init__ — so the __init__ guard never fired and the child kept kind=None. Set kind=headset in the pairing_info dict the receiver already passes into Device.__init__, which covers the bridge path. Both paths now seed the kind offline. --- lib/logitech_receiver/centurion.py | 3 ++- tests/logitech_receiver/test_hidpp20_complex.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/logitech_receiver/centurion.py b/lib/logitech_receiver/centurion.py index 00bb9e6f..6a411f78 100644 --- a/lib/logitech_receiver/centurion.py +++ b/lib/logitech_receiver/centurion.py @@ -35,6 +35,7 @@ from solaar import configuration from . import base from . import exceptions from . import hidpp10 +from . import hidpp10_constants from .centurion_constants import CenturionCoreFeature from .common import Alert from .common import Battery @@ -376,7 +377,7 @@ class CenturionReceiver: # Create child Device with receiver=self, number=1 pairing_info = { "wpid": self.product_id, - "kind": None, + "kind": hidpp10_constants.DEVICE_KIND.headset, # every Centurion-transport device so far is a headset "serial": None, "polling": None, "power_switch": None, diff --git a/tests/logitech_receiver/test_hidpp20_complex.py b/tests/logitech_receiver/test_hidpp20_complex.py index 39d2e456..14bce23b 100644 --- a/tests/logitech_receiver/test_hidpp20_complex.py +++ b/tests/logitech_receiver/test_hidpp20_complex.py @@ -1213,6 +1213,21 @@ def test_centurion_receiver_container_with_device(): recv[2] +def test_centurion_receiver_child_device_kind_headset(): + """notify_devices() seeds the headset child with kind=headset via pairing_info, + so the headphone icon shows even when the headset is powered off at startup.""" + info = FakeCenturionDeviceInfo(product="PRO X 2 LIGHTSPEED") + recv = CenturionReceiver(FakeLowLevel(), 0x99, info) + recv._pending = False + recv._dongle_features = [] + + recv.notify_devices() + + child = recv[1] + child.online = False + assert child.kind == "headset" + + def test_centurion_receiver_enable_connection_notifications(): """CenturionReceiver.enable_connection_notifications() returns False.""" info = FakeCenturionDeviceInfo()