flozz / rivalcfg

CLI tool and Python library to configure SteelSeries gaming mice
https://flozz.github.io/rivalcfg/
Do What The F*ck You Want To Public License
761 stars 62 forks source link

How to flush updated mouse settings through the python API? #180

Closed mvrozanti closed 2 years ago

mvrozanti commented 2 years ago

Hi, I was really glad to find this project, I recently got a Rival 300 and tinkered with the settings through the cli a bit and it worked great

Now I'm trying to use the Python API with the following script:

import rivalcfg
mouse = rivalcfg.get_first_mouse()
mouse_settings = mouse.mouse_settings
mouse_settings.set('z1_color', 'fff')
mouse_settings.save()
mouse.save()

And while I get no errors, the colors don't update. I read the docs but couldn't find a way to actually flush the changes. What am I missing here?

mvrozanti commented 2 years ago

After taking a look in the main file, I got it working like this:

import rivalcfg
mouse = rivalcfg.get_first_mouse()
mouse.set_z1_color('fff')

Turns out I just needed to call the method in the mouse object!

flozz commented 2 years ago

mouse_settings are just a way to read/save settings from/to the HDD (as we cannot read-back values from the device), not to communicate with the mouse. They can be useful to know the current state of the mouse (if it is only used on one machine and configured only with rivalcfg). :)