receiver: fix bug in determining kind of devices for 27Mz receivers

This commit is contained in:
Peter F. Patel-Schneider 2023-02-06 11:28:34 -05:00
parent 39f6341a8f
commit d41c607188
2 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ class Device:
# get 27Mhz wpid and set kind based on index # get 27Mhz wpid and set kind based on index
if receiver.receiver_kind == '27Mhz': # 27 Mhz receiver if receiver.receiver_kind == '27Mhz': # 27 Mhz receiver
self.wpid = '00' + _strhex(link_notification.data[2:3]) self.wpid = '00' + _strhex(link_notification.data[2:3])
kind = self.get_kind_from_index(number, receiver) kind = receiver.get_kind_from_index(number)
self._kind = _hidpp10.DEVICE_KIND[kind] self._kind = _hidpp10.DEVICE_KIND[kind]
else: else:
# Not a notification, force a reading of pairing information # Not a notification, force a reading of pairing information

View File

@ -174,7 +174,7 @@ class Receiver:
if not wpid: if not wpid:
_log.error('Unable to get wpid from udev for device %d of %s', n, self) _log.error('Unable to get wpid from udev for device %d of %s', n, self)
raise _base.NoSuchDevice(number=n, receiver=self, error='Not present 27Mhz device') raise _base.NoSuchDevice(number=n, receiver=self, error='Not present 27Mhz device')
kind = _hidpp10.DEVICE_KIND[self.get_kind_from_index(n, self)] kind = _hidpp10.DEVICE_KIND[self.get_kind_from_index(n)]
elif not self.receiver_kind == 'unifying': # unifying protocol not supported, may be an old Nano receiver elif not self.receiver_kind == 'unifying': # unifying protocol not supported, may be an old Nano receiver
device_info = self.read_register(_R.receiver_info, 0x04) device_info = self.read_register(_R.receiver_info, 0x04)
if device_info: if device_info: