cli: correct reporting for pairing with receivers that re-pair (i.e., c534)

This commit is contained in:
Peter F. Patel-Schneider 2020-01-23 17:17:36 -05:00 committed by Filipe Laíns
parent d08e0a9574
commit e89b50cdf2
1 changed files with 5 additions and 1 deletions

View File

@ -57,9 +57,13 @@ def run(receivers, args, find_receiver, _ignore):
assert n
if n.devnumber == 0xFF:
_notifications.process(receiver, n)
elif n.sub_id == 0x41 and n.address == 0x04:
elif n.sub_id == 0x41: # allow for other protocols! (was and n.address == 0x04)
if n.devnumber not in known_devices:
receiver.status.new_device = receiver[n.devnumber]
elif receiver.re_pairs:
# unfortunately this breaks encapsulation but the nice way tries to unpair
del receiver._devices[n.devnumber] # get rid of information on device re-paired away
receiver.status.new_device = receiver[n.devnumber]
timeout = 20 # seconds
receiver.handle = _HandleWithNotificationHook(receiver.handle)