Skip to content

Commit

Permalink
device: correctly enumerate devices on receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps committed Nov 23, 2023
1 parent bfa3c92 commit d9e5e33
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/logitech_receiver/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d9e5e33

Please sign in to comment.