File: basic_effect.py

package info (click to toggle)
openrazer 2.9.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,176 kB
  • sloc: python: 9,377; ansic: 8,091; sh: 580; makefile: 179; xml: 141
file content (21 lines) | stat: -rw-r--r-- 725 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from openrazer.client import DeviceManager
from openrazer.client import constants as razer_constants

# Create a DeviceManager. This is used to get specific devices
device_manager = DeviceManager()


print("Found {} Razer devices".format(len(device_manager.devices)))
print()

# Disable daemon effect syncing.
# Without this, the daemon will try to set the lighting effect to every device.
device_manager.sync_effects = False

# Iterate over each device and set the wave effect
for device in device_manager.devices:
    print("Setting {} to wave".format(device.name))

    # Set the effect to wave.
    # wave requires a direction, but different effect have different arguments.
    device.fx.wave(razer_constants.WAVE_LEFT)