LoLei / razer-cli

CLI for configuring Razer devices
GNU General Public License v3.0
92 stars 11 forks source link

Needs testing on more devices #17

Open LoLei opened 5 years ago

LoLei commented 5 years ago

If anyone has Razer devices, keyboards, mice, headsets, etc., I'd appreciate it if you could test if everything works for you, and if not, tell me, or open a PR yourself!

LoLei commented 4 years ago

Confirmed working on:

ifohancroft commented 4 years ago

Using the Viper Ultimate wirelessly by plugging the dock with cable into the PC and plugging the dongle in the dock, the following command parameters give the following error: razer-cli -v, razer-cli -l, razer-cli -ll, razer-cli -d and razer-cli -a

Traceback (most recent call last):
  File "/home/ifohancroft/.local/bin/razer-cli", line 8, in <module>
    sys.exit(main())
  File "/home/ifohancroft/.local/lib/python3.8/site-packages/razer_cli/razer_cli.py", line 314, in main
    color = set_color(args.color)
  File "/home/ifohancroft/.local/lib/python3.8/site-packages/razer_cli/razer_cli.py", line 67, in set_color
    r, g, b = get_x_color()
  File "/home/ifohancroft/.local/lib/python3.8/site-packages/razer_cli/razer_cli.py", line 48, in get_x_color
    r, g, b = util.hex_to_decimal(rgb)
  File "/home/ifohancroft/.local/lib/python3.8/site-packages/razer_cli/util.py", line 6, in hex_to_decimal
    r = int(hex_color[0:2], 16)
ValueError: invalid literal for int() with base 16: ''

Where, razer-cli -v also says: "Starting Razer colors script..." before showing the error.

LoLei commented 4 years ago

@ifohancroft Thanks for reporting this! Could you please run the following and tell me the output:
xrdb -query | grep "*color1:" | awk -F '#' '{print $2}'

My guess it it always tries to get colors from Xresources even if none have ever been set.

ifohancroft commented 4 years ago

@LoLei Most welcome! The output is empty.

LoLei commented 4 years ago

Please see if the newest version fixes it.

ifohancroft commented 4 years ago

Thank you! All the parameters seems to work now. There are a couple of problems I have found now:

  1. razer-cli -v or razer-cli --verbose gives me the following info:
    Starting Razer colors script...
    RBG: 
    0 0 0

And regardless of whether I run it on its own or with another parameter, it doesn't seem to have an effect on the verbosity of the output.

  1. The information about my mouse in razer-cli -l or ll is a bit wrong:
    Found 1 Razer devices
    Razer Viper Ultimate (Wireless):
    type: mouse
    DPI: (0, 0)
    max DPI: 20000
    serial: UNKWN000000002440
    firmware version: v0.0
    driver version: 2.8.0
    effects: ['logo_breath_single', 'logo_reactive', 'logo_static']
    capabilities: {'name': True, 'type': True, 'firmware_version': True, 'serial': True, 'brightness': False, 'macro_logic': False, 'keyboard_layout': False, 'lighting': False, 'lighting_breath_single': False, 'lighting_breath_dual': False, 'lighting_breath_triple': False, 'lighting_breath_random': False, 'lighting_wave': False, 'lighting_reactive': False, 'lighting_none': False, 'lighting_spectrum': False, 'lighting_static': False, 'lighting_starlight_single': False, 'lighting_starlight_dual': False, 'lighting_starlight_random': False, 'lighting_ripple': False, 'lighting_ripple_random': False, 'lighting_pulsate': False, 'lighting_led_matrix': True, 'lighting_led_single': False, 'lighting_logo': True, 'lighting_logo_active': False, 'lighting_logo_blinking': False, 'lighting_logo_brightness': True, 'lighting_logo_pulsate': False, 'lighting_logo_spectrum': True, 'lighting_logo_static': True, 'lighting_logo_none': True, 'lighting_logo_reactive': True, 'lighting_logo_wave': True, 'lighting_logo_breath_single': True, 'lighting_logo_breath_dual': True, 'lighting_logo_breath_random': True, 'lighting_scroll': False, 'lighting_scroll_active': False, 'lighting_scroll_blinking': False, 'lighting_scroll_brightness': False, 'lighting_scroll_pulsate': False, 'lighting_scroll_spectrum': False, 'lighting_scroll_static': False, 'lighting_scroll_none': False, 'lighting_scroll_reactive': False, 'lighting_scroll_wave': False, 'lighting_scroll_breath_single': False, 'lighting_scroll_breath_dual': False, 'lighting_scroll_breath_random': False, 'lighting_left': False, 'lighting_left_active': False, 'lighting_left_brightness': False, 'lighting_left_spectrum': False, 'lighting_left_static': False, 'lighting_left_none': False, 'lighting_left_reactive': False, 'lighting_left_wave': False, 'lighting_left_breath_single': False, 'lighting_left_breath_dual': False, 'lighting_left_breath_random': False, 'lighting_right': False, 'lighting_right_active': False, 'lighting_right_brightness': False, 'lighting_right_spectrum': False, 'lighting_right_static': False, 'lighting_right_none': False, 'lighting_right_reactive': False, 'lighting_right_wave': False, 'lighting_right_breath_single': False, 'lighting_right_breath_dual': False, 'lighting_right_breath_random': False, 'lighting_backlight': False, 'lighting_backlight_active': False, 'lighting_profile_led_red': False, 'lighting_profile_led_green': False, 'lighting_profile_led_blue': False, 'poll_rate': True, 'dpi': True, 'available_dpi': False, 'battery': False}

    Here is the list of the wrong things in the info:

    • I haven't set the DPI for X and Y separately, so I am not sure how the output should show it (perhaps show the same number for each axis?) but my DPI is 400 and the output says DPI: (0,0)
    • The serial number is wrong
    • The firmware version is wrong
    • I am not sure about the effects values (seems right at first sight but I feel like it has more effects than that
    • The capabilities are wrong and some are also confusing. I mean for examle 'name': True, 'type': True, 'firmware_version': True, 'serial': True or 'lighting': False (this one should definitely be true). The gist of it is that there are booleans shown where there should be integer or string values. However, at first glance the lighting part of the capabilities seems to be correct as the mouse only has logo lighting.

P.S. I am not sure if openrazer included support for the mouse dock but shouldn't razer-cli also show the dock in the list of the devices?

LoLei commented 4 years ago

Glad that is fixed now.

Ad. 1.: The verbose flag's effects are only visible in certain functions. Essentially, if you look at the code, wherever args.verbose is checked and something is printed. If you want you can certainly add some additional verbose prints and create a PR. It's Hacktoberfest after all.

Ad. 2.: This information comes directly from openrazer, razer-cli has no real influence on it.

The DPI value works for my mouse. Maybe try setting it once with razer-cli and see if it shows up correctly then? That's not a fix of course, but would be interesting nonetheless.

The serial and firmware numbers are most likely due to openrazer. (https://github.com/openrazer/openrazer/pull/1164, https://github.com/openrazer/openrazer/issues/987, although in theory it should be in v2.8.0.)

The list of effects shows only the intersection of effects the device has and those that are implemented in razer-cli. For all effects, see the capabilities section. This is in fact a map of capabilities to booleans, because it only says whether a certain capability is supported on the device. For example for your mouse, lighting_logo_static is true because this effect can be controlled via the openrazer pylib (called logo_static in razer-cli). lighting itself is a different effect that cannot be activated for this particular device. If you see effect capabilties that are true for your device but are not yet supported in razer-cli, I'd also appreciate a pull request that implements these.

The openrazer mouse dock support still seems to be in progress (https://github.com/openrazer/openrazer/issues/1018).

ifohancroft commented 4 years ago
  1. Python's definitely not my strong suite but I'd definitely play with stuff when I have the time and if I come up with anything worthy, I'll definitely open up a PR.

  2. The DPI is still shown as DPI: (0, 0) even after setting the DPI with razer-cli.

Regarding the list of capabilities - When it comes to lighting and such, it makes sense. I mostly found it weird when it comes to the 'name', 'type' and 'firmware_version' that their values are True instead of a string or an integer.

LoLei commented 4 years ago

Alright thanks for testing that out again.

You're right the capabilities are definitely counter-intuitive. It's pretty clear that all devices support the name capability for example.

LoLei commented 4 years ago

@all-contributors please add @ifohancroft for bug and userTesting

allcontributors[bot] commented 4 years ago

@LoLei

I've put up a pull request to add @ifohancroft! :tada: