Repository: pwr-Solaar/Solaar

Issue:
G502 (wired) mouse support
**Information**
<!-- Please update to Solaar from this repository before asking for a new feature. -->
- Solaar version (`solaar --version` and `git describe --tags`): 1.0.6
- Distribution: ElementaryOS
- Kernel version (ex. `uname -srmo`): Linux 5.4.0-74-generic x86_64 GNU/Linux
- Output of `solaar show` for the target device (if applicable): 

<details>

```
solaar: error: Traceback (most recent call last):
  File "/usr/share/solaar/lib/solaar/cli/__init__.py", line 203, in run
    raise Exception('No devices found')
Exception: No devices found
```
</details>


**Description**
I've just switched to linux, and thought there is a GHub for it, but it turned out there isn't. I have posted my problem on their reddit, and someone told me to check out solaar. I have downloaded it, but it looks like there is no support for G502 Hero mouse (wired).

**Describe the solution you'd like**
Add support for G502 Hero mouse

P.S.: I hope it is possible :)



Discussion:
I have a G502 and it is working fine.  Run `lsusb`.  There should be a line like:
```
Bus ... Device ...: ID 046d:c539 Logitech, Inc. USB Receiver
```
The c539 is the id number for the G502's receiver.  If you don't  have this line then you might have a newer or older receiver than I have.   Please post the output of `lsusb`
```
Bus 001 Device 008: ID 046d:c08b Logitech, Inc.
```

Do you need the whole list?

Edit: Seems like it is not in the supported list. (Sorry for not checking that the first time, I am just a beginner linux user and didn't even know how to check the receiver version). I hope it is possible to add it in a future update
Oh, you have your mouse wired.  When my 502 is wired I see
```
Bus 003 Device 006: ID 046d:c08d Logitech, Inc. G502 LIGHTSPEED Wireless Gaming Mouse
```
It looks as if you have a slightly different mouse.

It appears that the problem is that you are running an old version of Linux that does not fully recognize your mouse when it is wired.  Solaar doesn't need information on Logitech devices that connect directly via wireless but they do need to be fully recognized by the OS.

If your mouse can connect via a wireless receiver try that.  Otherwise it is very likely that the only way to have Solaar work for your mouse is to upgrade your OS.   Linux 5.4 is old - I run 5.11 and will be switching to 5.12 soon.
Sorry, I am confused. What do you mean when your 502 is wired? Since I think you have the wireless version. Also, I have the G502 Hero, not the G502, and that could have inner changes.

Regarding the OS update: I have elementaryOS, and I think I've heard that it updates when a new elementary version comes out. Not sure, but currently I don't see any available system updates for the OS.
I have a G502 that can be either connected via a USB cable or communicate wirelessly to a special USB dongle, called a receiver.   You may have a different version that can only be connected via a USB cable.

Elementary OS is a distribution for Linux.  It appears to not be updated very often, or purposely sticks with older versions of the Linux kernel.  Other distributions (Fedora, in particular) update to newer versions of the Linux kernel shortly after they come out.  Thus they get the benefits of newer capabilities, drivers, etc., at the cost of more rapid change and maybe exposure to bugs.
@AdamTmHun Have you been able to address your issue?
Hey,

Actually, thanks for reminding. I just switched to Ubuntu, since other stuff like Unity wasn't working properly on Elementary. Let me check if it works now
It didn't solve the issue.

Except, I see for some reason, it installs the 1.0.1 version instead of the 1.0.6, and I don't know why. In the command line, it says it is installing the 1.0.6, but its not.

Terminal:
```
adam@adam-pc:~$ sudo apt install solaar
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gir1.2-appindicator3-0.1 python3-psutil python3-pyudev python3-xlib
Suggested packages:
  python-psutil-doc
The following NEW packages will be installed:
  gir1.2-appindicator3-0.1 python3-psutil python3-pyudev python3-xlib solaar
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 460 kB/497 kB of archives.
After this operation, 2.997 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://hu.archive.ubuntu.com/ubuntu focal/main amd64 gir1.2-appindicator3-0.1 amd64 12.10.1+20.04.20200408.1-0ubuntu1 [3.448 B]
Get:2 http://hu.archive.ubuntu.com/ubuntu focal/main amd64 python3-psutil amd64 5.5.1-1ubuntu4 [141 kB]
Get:3 http://hu.archive.ubuntu.com/ubuntu focal/universe amd64 python3-xlib all 0.23-2build1 [112 kB]
Get:4 http://ppa.launchpad.net/solaar-unifying/ppa/ubuntu focal/main amd64 solaar all 1.0.6+git1363-8854ca6-202106160734~ubuntu20.04.1 [203 kB]
Fetched 460 kB in 0s (1.561 kB/s)                   
Preconfiguring packages ...
Selecting previously unselected package gir1.2-appindicator3-0.1.
(Reading database ... 177357 files and directories currently installed.)
Preparing to unpack .../gir1.2-appindicator3-0.1_12.10.1+20.04.20200408.1-0ubunt
u1_amd64.deb ...
Unpacking gir1.2-appindicator3-0.1 (12.10.1+20.04.20200408.1-0ubuntu1) ...
Selecting previously unselected package python3-psutil.
Preparing to unpack .../python3-psutil_5.5.1-1ubuntu4_amd64.deb ...
Unpacking python3-psutil (5.5.1-1ubuntu4) ...
Selecting previously unselected package python3-pyudev.
Preparing to unpack .../python3-pyudev_0.21.0-3ubuntu1_all.deb ...
Unpacking python3-pyudev (0.21.0-3ubuntu1) ...
Selecting previously unselected package python3-xlib.
Preparing to unpack .../python3-xlib_0.23-2build1_all.deb ...
Unpacking python3-xlib (0.23-2build1) ...
Selecting previously unselected package solaar.
Preparing to unpack .../solaar_1.0.6+git1363-8854ca6-202106160734~ubuntu20.04.1_
all.deb ...
Unpacking solaar (1.0.6+git1363-8854ca6-202106160734~ubuntu20.04.1) ...
Setting up python3-xlib (0.23-2build1) ...
Setting up python3-psutil (5.5.1-1ubuntu4) ...
Setting up gir1.2-appindicator3-0.1 (12.10.1+20.04.20200408.1-0ubuntu1) ...
Setting up python3-pyudev (0.21.0-3ubuntu1) ...
Setting up solaar (1.0.6+git1363-8854ca6-202106160734~ubuntu20.04.1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu2) ...
Rebuilding /usr/share/applications/bamf-2.index...
```

But in the application, it says 1.0.1

If the version isn't the problem, then it still isn't working for some reason.

Edit: The cmd `solaar --version` shows 1.0.6, wtf???

Edit 2: My new kernel and ubuntu version: `Linux 5.8.0-55-generic x86_64 GNU/Linux`, `Ubuntu 20.04.2 LTS 64-bit`
`lsusb` result: 
```
Bus 001 Device 002: ID 046d:c08b Logitech, Inc. G502 HERO Gaming Mouse
```
Running Solaar from the terminal with cmd `solaar` instead of from the app list, it shows it needs `udve`, but it was already installed when installing solaar. After the error, it opens the GUI, and the version is still 1.0.1 in the about section.
The output from lsusb indicates that a modern version of Solaar should work for your mouse.

The issue that you are seeing with versions is probably due to the fact that the Solaar GUI starts up by looking for any already-running programs that provide a Solaar GUI and quickly quitting if there is one.  So if Solaar 1.0.1 is already running (as a startup program or whatever) the only thing that will happen if you try to run `solaar` is that the main window of the already-running Solaar will be shown.  To get around this you need to find and kill this program, e.g., via `killall solaar`.
This worked, now its 1.0.6, but the mouse is still not showing up.
I expect that the problem is that permissions are not being set up for the mouse.  You should run `ls -l /dev/hidraw*`, then disconnect and reconnect your mouse, then run `ls -l /dev/hidraw*` again.  There should be a change in the output, with at least one line starting with `crw-rw----+`.  The '+' indicates that special permissions have been set up.  If there is no change then you may have to reboot.  If there is still no change then I'll have to figure out what the problem is.

Then run Solaar.   The mouse should show up, but the main window will very likely look a bit wrong - the short name for the mouse is likely to be something like '?? (C08B)'.   Let me know what shows up there and also the long name at the top of the right-hand side of the main window.
Nope, no mouse is shown. Also, running `ls -l /dev/hidraw*` showed two line starting with `crw-rw----+`, both for the first and the second time.
Hmm.  Are any devices or receivers shown on your Solaar main window?  If so, click on them and then on the little light bulb icon (towards the bottom, sort of in the middle).   What is the path given for each of them?  What is the output of `ls -l /dev/hidraw*`?  What is the output of `udevadm info -n /dev/hidraw*`?

Another possibility is that your mouse uses a different interface than modern Logitech devices that connect via USB.   This is probably fixable.  But try the above first.

The bad possibility is that your mouse doesn't talk the HID++ protocol that Solaar needs.  This would not be fixable.
Are you still having the problem?
I have the same problem, same mouse too :/

Information

    Solaar version (solaar --version and git describe --tags): solaar 1.1.1
    Distribution: Mint
    Kernel version (ex. uname -srmo): Linux 5.13.0-27-generic x86_64 GNU/Linux
    Output of solaar show for the target device (if applicable):

Description
I've just switched to linux, and thought there is a GHub for it, but it turned out there isn't. I have posted my problem on their reddit, and someone told me to check out solaar. I have downloaded it, but it looks like there is no support for G502 Hero mouse (wired).
What USB id does this mouse have?   Provide output of lsusb with the mouse connected.   Does the mouse show up at all in Solaar?
> What USB id does this mouse have? Provide output of lsusb with the mouse connected. Does the mouse show up at all in Solaar?

Bus 001 Device 003: ID 046d:c08b Logitech, Inc. G502 HERO Gaming Mouse

No it doesn't show :/
Is is likely that this device uses a different USB interface so Solaar needs to know which one.  

Look at output of `lsusb` to find ID of device or receiver, which you already have done.
Provide output of `lsusb -vv -d xxxx:yyyy` where xxxx:yyyy is ID of device or receiver.

Look at output of `grep -H . /sys/class/hidraw/hidraw*/device/uevent` to find directory for the device or receiver, e.g., `/sys/class/hidraw/hidraw3/device/uevent:HID_NAME=Logitech USB Receiver`.
Provide contents of the file `/sys/class/hidraw/hidrawN/device/report_descriptor` where N was found above.  You will have to copy the contents to a file with txt extension before attaching it.
Or, better, install hidrd-convert and provide output of `hidrd-convert -o spec /sys/class/hidraw/hidrawN/device/report_descriptor`.


Can you provide the information requested?
Closing due to no response.
Hi, I hate to be the 3rd person to re-open this issue but I have this same mouse and am experiencing the same issue.

```
➜ lsusb | grep -i logitech
Bus 003 Device 017: ID 046d:c08b Logitech, Inc. G502 SE HERO Gaming Mouse
```

[Here is the rest of the information you requested from the previous several comments](https://github.com/pwr-Solaar/Solaar/files/8207751/g502.txt)

Resolving patch:
diff --git a/lib/logitech_receiver/descriptors.py b/lib/logitech_receiver/descriptors.py
--- a/lib/logitech_receiver/descriptors.py
+++ b/lib/logitech_receiver/descriptors.py
@@ -178,6 +178,8 @@ def get_btid(btid):
 # Devices are organized by kind
 # Within kind devices are sorted by wpid, then by usbid, then by btid, with missing values sorted later
 
+# yapf: disable
+
 # Keyboards
 
 _D('Wireless Keyboard S510', codename='S510', protocol=1.0, wpid='0056', registers=(_R.battery_status, ))
@@ -188,19 +190,8 @@ def get_btid(btid):
 _D('Wireless Keyboard MK700', protocol=1.0, wpid='2008', registers=(_R.battery_status, ), settings=[_ST.RegisterFnSwap])
 _D('Wireless Wave Keyboard K350', protocol=1.0, wpid='200A', registers=(_R.battery_status, ))
 _D('Wireless Keyboard MK320', protocol=1.0, wpid='200F', registers=(_R.battery_status, ))
-_D(
-    'Wireless Illuminated Keyboard K800',
-    protocol=1.0,
-    wpid='2010',
-    registers=(
-        _R.battery_status,
-        _R.three_leds,
-    ),
-    settings=[
-        _ST.RegisterFnSwap,
-        _ST.RegisterHandDetection,
-    ],
-)
+_D('Wireless Illuminated Keyboard K800', protocol=1.0, wpid='2010',
+    registers=(_R.battery_status, _R.three_leds), settings=[_ST.RegisterFnSwap, _ST.RegisterHandDetection])
 _D('Wireless Keyboard K520', protocol=1.0, wpid='2011', registers=(_R.battery_status, ), settings=[_ST.RegisterFnSwap])
 _D('Wireless Solar Keyboard K750', protocol=2.0, wpid='4002', settings=[_ST.FnSwap])
 _D('Wireless Keyboard K270 (unifying)', protocol=2.0, wpid='4003')
@@ -229,67 +220,21 @@ def get_btid(btid):
 _D('V400 Laser Cordless Mouse', codename='V400', protocol=1.0, wpid='1003', registers=(_R.battery_status, ))
 _D('MX610 Left-Handled Mouse', codename='MX610L', protocol=1.0, wpid='1004', registers=(_R.battery_status, ))
 _D('V450 Laser Cordless Mouse', codename='V450', protocol=1.0, wpid='1005', registers=(_R.battery_status, ))
-_D(
-    'VX Revolution',
-    codename='VX Revolution',
-    kind=_DK.mouse,
-    protocol=1.0,
-    wpid=('1006', '100D', '0612'),
-    registers=(_R.battery_charge, )
-)
+_D('VX Revolution', codename='VX Revolution', kind=_DK.mouse, protocol=1.0, wpid=('1006', '100D', '0612'),
+    registers=(_R.battery_charge, ))
 _D('MX Air', codename='MX Air', protocol=1.0, kind=_DK.mouse, wpid=('1007', '100E'), registers=(_R.battery_charge, ))
-_D(
-    'MX Revolution',
-    codename='MX Revolution',
-    protocol=1.0,
-    kind=_DK.mouse,
-    wpid=('1008', '100C'),
-    registers=(_R.battery_charge, )
-)
+_D('MX Revolution', codename='MX Revolution', protocol=1.0, kind=_DK.mouse, wpid=('1008', '100C'),
+    registers=(_R.battery_charge, ))
 _D('MX620 Laser Cordless Mouse', codename='MX620', protocol=1.0, wpid=('100A', '1016'), registers=(_R.battery_charge, ))
-_D(
-    'VX Nano Cordless Laser Mouse',
-    codename='VX Nano',
-    protocol=1.0,
-    wpid=('100B', '100F'),
-    registers=(_R.battery_charge, ),
-    settings=[_ST.RegisterSmoothScroll, _ST.RegisterSideScroll]
-)
+_D('VX Nano Cordless Laser Mouse', codename='VX Nano', protocol=1.0, wpid=('100B', '100F'),
+    registers=(_R.battery_charge, ), settings=[_ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
 _D('V450 Nano Cordless Laser Mouse', codename='V450 Nano', protocol=1.0, wpid='1011', registers=(_R.battery_charge, ))
-_D(
-    'V550 Nano Cordless Laser Mouse',
-    codename='V550 Nano',
-    protocol=1.0,
-    wpid='1013',
-    registers=(_R.battery_charge, ),
-    settings=[
-        _ST.RegisterSmoothScroll,
-        _ST.RegisterSideScroll,
-    ],
-)
-_D(
-    'MX 1100 Cordless Laser Mouse',
-    codename='MX 1100',
-    protocol=1.0,
-    kind=_DK.mouse,
-    wpid='1014',
-    registers=(_R.battery_charge, ),
-    settings=[
-        _ST.RegisterSmoothScroll,
-        _ST.RegisterSideScroll,
-    ],
-)
-_D(
-    'Anywhere Mouse MX',
-    codename='Anywhere MX',
-    protocol=1.0,
-    wpid='1017',
-    registers=(_R.battery_charge, ),
-    settings=[
-        _ST.RegisterSmoothScroll,
-        _ST.RegisterSideScroll,
-    ],
-)
+_D('V550 Nano Cordless Laser Mouse', codename='V550 Nano', protocol=1.0, wpid='1013',
+    registers=(_R.battery_charge, ), settings=[_ST.RegisterSmoothScroll, _ST.RegisterSideScroll, ])
+_D('MX 1100 Cordless Laser Mouse', codename='MX 1100', protocol=1.0, kind=_DK.mouse, wpid='1014',
+    registers=(_R.battery_charge, ), settings=[_ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
+_D('Anywhere Mouse MX', codename='Anywhere MX', protocol=1.0, wpid='1017',
+    registers=(_R.battery_charge, ), settings=[_ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
 
 
 class _PerformanceMXDpi(_ST.RegisterDpi):
@@ -297,82 +242,23 @@ class _PerformanceMXDpi(_ST.RegisterDpi):
     validator_options = {'choices': choices_universe}
 
 
-_D(
-    'Performance Mouse MX',
-    codename='Performance MX',
-    protocol=1.0,
-    wpid='101A',
-    registers=(
-        _R.battery_status,
-        _R.three_leds,
-    ),
-    settings=[
-        _PerformanceMXDpi,
-        _ST.RegisterSmoothScroll,
-        _ST.RegisterSideScroll,
-    ],
-)
-_D(
-    'Marathon Mouse M705 (M-R0009)',
-    codename='M705 (M-R0009)',
-    protocol=1.0,
-    wpid='101B',
-    registers=(_R.battery_charge, ),
-    settings=[
-        _ST.RegisterSmoothScroll,
-        _ST.RegisterSideScroll,
-    ],
-)
+_D('Performance Mouse MX', codename='Performance MX', protocol=1.0, wpid='101A',
+    registers=(_R.battery_status, _R.three_leds),
+   settings=[_PerformanceMXDpi, _ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
+_D('Marathon Mouse M705 (M-R0009)', codename='M705 (M-R0009)', protocol=1.0, wpid='101B',
+    registers=(_R.battery_charge, ), settings=[_ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
 _D('Wireless Mouse M350', protocol=1.0, wpid='101C', registers=(_R.battery_charge, ))
-_D(
-    'Wireless Mouse M505',
-    codename='M505/B605',
-    protocol=1.0,
-    wpid='101D',
-    registers=(_R.battery_charge, ),
-    settings=[
-        _ST.RegisterSmoothScroll,
-        _ST.RegisterSideScroll,
-    ],
-)
+_D('Wireless Mouse M505', codename='M505/B605', protocol=1.0, wpid='101D',
+    registers=(_R.battery_charge, ), settings=[_ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
 _D('Wireless Mouse M305', protocol=1.0, wpid='101F', registers=(_R.battery_status, ), settings=[_ST.RegisterSideScroll])
 _D('Wireless Mouse M215', protocol=1.0, wpid='1020')
-_D(
-    'G700 Gaming Mouse',
-    codename='G700',
-    protocol=1.0,
-    wpid='1023',
-    usbid=0xc06b,
-    interface=1,
-    registers=(
-        _R.battery_status,
-        _R.three_leds,
-    ),
-    settings=[
-        _ST.RegisterSmoothScroll,
-        _ST.RegisterSideScroll,
-    ],
-)
+_D('G700 Gaming Mouse', codename='G700', protocol=1.0, wpid='1023', usbid=0xc06b, interface=1,
+    registers=(_R.battery_status, _R.three_leds,), settings=[_ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
 _D('Wireless Mouse M310', protocol=1.0, wpid='1024', registers=(_R.battery_status, ))
 _D('Wireless Mouse M510', protocol=1.0, wpid='1025', registers=(_R.battery_status, ), settings=[_ST.RegisterSideScroll])
 _D('Fujitsu Sonic Mouse', codename='Sonic', protocol=1.0, wpid='1029')
-_D(
-    'G700s Gaming Mouse',
-    codename='G700s',
-    protocol=1.0,
-    wpid='102A',
-    usbid=0xc07c,
-    interface=1,
-    registers=(
-        _R.battery_status,
-        _R.three_leds,
-    ),
-    settings=[
-        _ST.RegisterSmoothScroll,
-        _ST.RegisterSideScroll,
-    ],
-)
-
+_D('G700s Gaming Mouse', codename='G700s', protocol=1.0, wpid='102A', usbid=0xc07c, interface=1,
+    registers=(_R.battery_status, _R.three_leds,), settings=[_ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
 _D('Couch Mouse M515', protocol=2.0, wpid='4007')
 _D('Wireless Mouse M175', protocol=2.0, wpid='4008')
 _D('Wireless Mouse M325', protocol=2.0, wpid='400A', settings=[_ST.HiResScroll])
@@ -385,79 +271,30 @@ class _PerformanceMXDpi(_ST.RegisterDpi):
 _D('Wireless Mouse MX Master', codename='MX Master', protocol=4.5, wpid='4041', btid=0xb012)
 _D('Anywhere Mouse MX 2', codename='Anywhere MX 2', protocol=4.5, wpid='404A', settings=[_ST.HiresSmoothInvert])
 _D('Wireless Mouse M510', protocol=2.0, wpid='4051', codename='M510v2', settings=[_ST.LowresSmoothScroll])
-_D(
-    'Wireless Mouse M185 new',
-    codename='M185n',
-    protocol=4.5,
-    wpid='4054',
-    settings=[
-        _ST.LowresSmoothScroll,
-        _ST.PointerSpeed,
-    ]
-)
-_D(
-    'Wireless Mouse M185/M235/M310',
-    codename='M185/M235/M310',
-    protocol=4.5,
-    wpid='4055',
-    settings=[
-        _ST.LowresSmoothScroll,
-        _ST.PointerSpeed,
-    ]
-)
-_D(
-    'Wireless Mouse MX Master 2S',
-    codename='MX Master 2S',
-    protocol=4.5,
-    wpid='4069',
-    btid=0xb019,
-    settings=[
-        _ST.HiresSmoothInvert,
-    ],
-)
-_D(
-    'Multi Device Silent Mouse M585/M590',
-    codename='M585/M590',
-    protocol=4.5,
-    wpid='406B',
-    settings=[
-        _ST.LowresSmoothScroll,
-        _ST.PointerSpeed,
-    ],
-)
-_D(
-    'Marathon Mouse M705 (M-R0073)',
-    codename='M705 (M-R0073)',
-    protocol=4.5,
-    wpid='406D',
-    settings=[
-        _ST.HiresSmoothInvert,
-        _ST.PointerSpeed,
-    ]
-)
+_D('Wireless Mouse M185 new', codename='M185n', protocol=4.5, wpid='4054',
+    settings=[_ST.LowresSmoothScroll, _ST.PointerSpeed])
+_D('Wireless Mouse M185/M235/M310', codename='M185/M235/M310', protocol=4.5, wpid='4055',
+    settings=[_ST.LowresSmoothScroll, _ST.PointerSpeed])
+_D('Wireless Mouse MX Master 2S', codename='MX Master 2S', protocol=4.5, wpid='4069', btid=0xb019,
+    settings=[_ST.HiresSmoothInvert])
+_D('Multi Device Silent Mouse M585/M590', codename='M585/M590', protocol=4.5, wpid='406B',
+    settings=[_ST.LowresSmoothScroll, _ST.PointerSpeed])
+_D('Marathon Mouse M705 (M-R0073)', codename='M705 (M-R0073)', protocol=4.5, wpid='406D',
+    settings=[_ST.HiresSmoothInvert, _ST.PointerSpeed])
 _D('MX Vertical Wireless Mouse', codename='MX Vertical', protocol=4.5, wpid='407B', btid=0xb020, usbid=0xc08a)
 _D('Wireless Mouse Pebble M350', protocol=2.0, wpid='4080', codename='Pebble')
 _D('MX Master 3 Wireless Mouse', codename='MX Master 3', protocol=4.5, wpid='4082', btid=0xb023)
 _D('PRO X Wireless', kind='mouse', codename='PRO X', wpid='4093', usbid=0xc094)
-_D(
-    'G9 Laser Mouse',
-    codename='G9',
-    usbid=0xc048,
-    interface=1,
-    protocol=1.0,
-    settings=[
-        _PerformanceMXDpi,
-        _ST.RegisterSmoothScroll,
-        _ST.RegisterSideScroll,
-    ]
-)
+_D('G9 Laser Mouse', codename='G9', usbid=0xc048, interface=1, protocol=1.0,
+    settings=[_PerformanceMXDpi, _ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
 _D('G402 Gaming Mouse', codename='G402', usbid=0xc07e, interface=1)
 _D('G900 Chaos Spectrum Gaming Mouse', codename='G900', usbid=0xc081)
 _D('G403 Gaming Mouse', codename='G403', usbid=0xc082)
 _D('G903 Lightspeed Gaming Mouse', codename='G903', usbid=0xc086)
 _D('G703 Lightspeed Gaming Mouse', codename='G703', usbid=0xc087)
 _D('GPro Gaming Mouse', codename='GPro', usbid=0xc088)
-_D('G502 Hero Gaming Mouse', codename='G502 Hero', usbid=0xc08d)
+_D('G502 SE Hero Gaming Mouse', codename='G502 Hero', usbid=0xc08b, interface=1)
+_D('G502 Lightspeed Gaming Mouse', codename='G502', usbid=0xc08d)
 _D('MX518 Gaming Mouse', codename='MX518', usbid=0xc08e, interface=1)
 _D('G703 Hero Gaming Mouse', codename='G703 Hero', usbid=0xc090)
 _D('G903 Hero Gaming Mouse', codename='G903 Hero', usbid=0xc091)


Test patch: