From 5fddfb67ea1d97bad676f084b245b17e144f325a Mon Sep 17 00:00:00 2001 From: Ken Sanislo Date: Thu, 16 Apr 2026 09:35:57 -0700 Subject: [PATCH] Fix FeatureNotSupported crash on pending CenturionReceiver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a pending (deferred-init) CenturionReceiver has no discovered features, accessing receiver.firmware triggers get_firmware_centurion which calls feature_request. With an empty feature list, feature_request raises FeatureNotSupported — but passes a positional arg to KwException which only accepts **kwargs, producing a TypeError. Two fixes: - Guard firmware property with `not self._pending` so it skips fetch when features haven't been discovered yet - Fix FeatureNotSupported raise to use keyword argument --- lib/logitech_receiver/centurion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/logitech_receiver/centurion.py b/lib/logitech_receiver/centurion.py index e1b4b788..60d0d232 100644 --- a/lib/logitech_receiver/centurion.py +++ b/lib/logitech_receiver/centurion.py @@ -317,7 +317,7 @@ class CenturionReceiver: if feat_id == feature_int: request_id = (index << 8) | (function & 0xFF) return self.request(request_id, *params, no_reply=no_reply) - raise exceptions.FeatureNotSupported(feature) + raise exceptions.FeatureNotSupported(feature=feature) def _discover_dongle_features(self): """Independently discover features on the dongle hardware.""" @@ -361,7 +361,7 @@ class CenturionReceiver: @property def firmware(self): - if self._firmware is None and self.handle: + if self._firmware is None and self.handle and not self._pending: self._firmware = get_firmware_centurion(self) return self._firmware or ()