diff --git a/lib/solaar/cli/pair.py b/lib/solaar/cli/pair.py index 076d9ee1..3338a243 100644 --- a/lib/solaar/cli/pair.py +++ b/lib/solaar/cli/pair.py @@ -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)