Repository: pwr-Solaar/Solaar

Issue:
Cannot unpair logitech mouse from logitech nano receiver
**Information**
- solaar: 1.0.6 (pip3)
- Distribution: ubuntu 21.10
- Kernel version: Linux 5.13.0-16-generic x86_64 GNU/Linux

```
Nano Receiver
  Device path  : /dev/hidraw2
  USB id       : 046d:C52F
  Serial       : BEF9D3BF
    Firmware   : 30.00.B0009
  Has 1 paired device(s) out of a maximum of 1.
  Has 36 successful pairing(s) remaining.
  Notifications: wireless, software present (0x000900)

  1: Marathon Mouse M705 (M-R0073)
     Device path  : /dev/hidraw6
     WPID         : 406D
     Codename     : M705 (M-R0073)
     Kind         : mouse
     Protocol     : HID++ 4.5
     Polling rate : 8 ms (125Hz)
     Serial number: 1967999A
     Model ID:      406D00000000
     Unit ID:       AD21B902
        Bootloader: BOT 59.00.B0002
          Firmware: RQM 67.01.B0005
     The power switch is located on the base.
     Supports 27 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: DEVICE FW VERSION      {0003}   
            Firmware: Bootloader BOT 59.00.B0002 406D5F5048B901
            Firmware: Firmware RQM 67.01.B0005 406D5F5048B901
            Unit ID: AD21B902  Model ID: 406D00000000  Transport IDs: {'wpid': '406D'}
         3: DEVICE NAME            {0005}   
            Name: Marathon Mouse/Performance Plus M705
            Kind: mouse
         4: WIRELESS DEVICE STATUS {1D4B}   
         5: RESET                  {0020}   
         6: BATTERY STATUS         {1000}   
            Battery: 50%, discharging, next level 20%.
         7: REPROG CONTROLS V4     {1B04}   
            Key/Button Actions (saved): {'80': 80, '81': 81, '82': 82, '83': 83, '86': 86, '91': 91, '93': 93}
            Key/Button Actions        : {'80': 80, '81': 81, '82': 82, '83': 83, '86': 86, '91': 91, '93': 93}
         8: POINTER SPEED          {2205}   
            Pointer Speed: 1.0
            Sensitivity (Pointer Speed) (saved): 256
            Sensitivity (Pointer Speed)        : 256
         9: VERTICAL SCROLLING     {2100}   
            Roller type: 3G
            Ratchet per turn: 24
            Scroll lines: 0
        10: DFUCONTROL SIGNED      {00C2}   
        11: DEVICE RESET           {1802}   internal, hidden
        12: unknown:1803           {1803}   internal, hidden
        13: CONFIG DEVICE PROPS    {1806}   internal, hidden
        14: unknown:1810           {1810}   internal, hidden
        15: unknown:1830           {1830}   internal, hidden
        16: unknown:1890           {1890}   internal, hidden
        17: unknown:18A1           {18A1}   internal, hidden
        18: unknown:1DF3           {1DF3}   internal, hidden
        19: unknown:1E00           {1E00}   hidden
        20: unknown:1EB0           {1EB0}   internal, hidden
        21: unknown:1861           {1861}   internal, hidden
        22: unknown:18B1           {18B1}   internal, hidden
        23: unknown:1850           {1850}   internal, hidden
        24: unknown:1F03           {1F03}   internal, hidden
        25: unknown:18C0           {18C0}   internal, hidden
        26: HIRES WHEEL            {2121}   
            Multiplier: 8
            Has invert: Normal wheel motion
            Has ratchet switch: Free wheel mode
            High resolution mode
            HID notification
            Scroll Wheel Direction (saved): False
            Scroll Wheel Direction        : False
            Scroll Wheel Resolution (saved): True
            Scroll Wheel Resolution        : True
     Has 7 reprogrammable keys:
         0: Left Button               , default: Left Click                  => Left Click                
             mse, reprogrammable, pos:0, group:1, group mask:g1
             reporting: default
         1: Right Button              , default: Right Click                 => Right Click               
             mse, reprogrammable, pos:0, group:1, group mask:g1
             reporting: default
         2: Middle Button             , default: Mouse Middle Button         => Mouse Middle Button       
             mse, reprogrammable, divertable, pos:0, group:2, group mask:g1,g2
             reporting: default
         3: Back Button               , default: Mouse Back Button           => Mouse Back Button         
             mse, reprogrammable, divertable, pos:0, group:2, group mask:g1,g2
             reporting: default
         4: Forward Button            , default: Mouse Forward Button        => Mouse Forward Button      
             mse, reprogrammable, divertable, pos:0, group:2, group mask:g1,g2
             reporting: default
         5: Left Tilt                 , default: Mouse Scroll Left Button    => Mouse Scroll Left Button  
             mse, reprogrammable, divertable, pos:0, group:2, group mask:g1,g2
             reporting: default
         6: Right Tilt                , default: Mouse Scroll Right Button   => Mouse Scroll Right Button 
             mse, reprogrammable, divertable, pos:0, group:2, group mask:g1,g2
             reporting: default
     Battery: 50%, discharging, next level 20%.
```

**Describe the bug**
Hitting the unpair button has no effect: the mouse remains paired no matter what.
The following error appears the second time I hit the unpair button:
```
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/solaar/ui/window.py", line 201, in _unpair_current_device
    assert bool(device)
AssertionError
```

**Additional context**
Solaar has been installed following the guidelines outlined [here](https://pwr-solaar.github.io/Solaar/installation).



Discussion:

Resolving patch:
diff --git a/lib/logitech_receiver/base_usb.py b/lib/logitech_receiver/base_usb.py
--- a/lib/logitech_receiver/base_usb.py
+++ b/lib/logitech_receiver/base_usb.py
@@ -126,7 +126,7 @@
 UNIFYING_RECEIVER_C532 = _unifying_receiver(0xc532)
 
 # Nano receviers that support the Unifying protocol
-NANO_RECEIVER_ADVANCED = _nano_receiver(0xc52f)
+NANO_RECEIVER_ADVANCED = _nano_receiver_no_unpair(0xc52f)
 
 # ex100 old style receiver pre-unifyimg protocol
 EX100_27MHZ_RECEIVER_C517 = _ex100_receiver(0xc517)


Test patch: