receiver: remove spurious part of special handling for ex100 receiver

This commit is contained in:
Peter F. Patel-Schneider 2020-08-28 08:35:34 -04:00
parent 7fdba7fe75
commit b0297694d1
2 changed files with 4 additions and 17 deletions

View File

@ -79,17 +79,8 @@ class Device(object):
if link_notification is not None:
self.online = not bool(ord(link_notification.data[0:1]) & 0x40)
self.wpid = _strhex(link_notification.data[2:3] + link_notification.data[1:2])
# assert link_notification.address == (0x04
# if unifying else 0x03)
# assert link_notification.address == (0x04 if unifying else 0x03)
kind = ord(link_notification.data[0:1]) & 0x0F
# fix EX100 wpid
if receiver.ex100_wpid_fix: # EX100 receiver
self.wpid = _strhex(link_notification.data[2:3]) + '00'
# workaround for EX100 switched kind
if self.wpid == '3F00':
kind = 2
if self.wpid == '6500':
kind = 1
self._kind = _hidpp10.DEVICE_KIND[kind]
else:
# force a reading of the wpid

View File

@ -202,13 +202,9 @@ def _process_hidpp10_notification(device, status, n):
0x0A else 'Lightspeed 1' if n.address == 0x0C else 'Lightspeed 1_1' if n.address == 0x0D else None
)
if protocol_name:
if _log.isEnabledFor(_DEBUG):
wpid = _strhex(n.data[2:3] + n.data[1:2])
# workaround for short EX100 wpids
if protocol_name == '27 MHz':
wpid = _strhex(n.data[2:3]) + '00'
assert wpid == device.wpid, '%s wpid mismatch, got %s' % (device, wpid)
wpid = _strhex(n.data[2:3] + n.data[1:2])
if wpid != device.wpid:
_log.warn('%s wpid mismatch, got %s', device, wpid)
flags = ord(n.data[:1]) & 0xF0
link_encrypted = bool(flags & 0x20)
link_established = not (flags & 0x40)