From d9e5e339473a32d27e8d450a6928a2e6402871ff Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Thu, 23 Nov 2023 09:39:56 -0500 Subject: [PATCH] device: correctly enumerate devices on receiver --- lib/logitech_receiver/receiver.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/logitech_receiver/receiver.py b/lib/logitech_receiver/receiver.py index 9fde2e577..c0ea3857f 100644 --- a/lib/logitech_receiver/receiver.py +++ b/lib/logitech_receiver/receiver.py @@ -180,6 +180,10 @@ def device_pairing_information(self, n): if device_info: wpid = _strhex(device_info[3:5]) kind = _hidpp10.DEVICE_KIND[0x00] # unknown kind + else: + raise _base.NoSuchDevice(number=n, receiver=self, error='read pairing information - non-unifying') + else: + raise _base.NoSuchDevice(number=n, receiver=self, error='read pairing information') return wpid, kind, polling_rate def device_extended_pairing_information(self, n): @@ -238,8 +242,8 @@ def register_new_device(self, number, notification=None): _log.info('%s: found new device %d (%s)', self, number, dev.wpid) self._devices[number] = dev return dev - except _base.NoSuchDevice: - _log.exception('register_new_device') + except _base.NoSuchDevice as e: + _log.warn('register new device failed for %s device %d error %s', e.receiver, e.number, e.error) _log.warning('%s: looked for device %d, not found', self, number) self._devices[number] = None