File: basic_effect.py

package info (click to toggle)
openrazer 3.10.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,208 kB
  • sloc: ansic: 13,647; python: 11,795; sh: 575; xml: 261; makefile: 133
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)