Classes

OpenRGB

This is the main class you’ll be interfacing with to control OpenRGB, implementing the SDK server protocol.

Ideally, the only functions that a relevant for general use are client_name() and devices() as with devices() you gain access to Objects representing most of what you would have interest in doing.

class openrgb.OpenRGB(host, port=6742, client_string='python client')[source]
client_name(name=None)[source]

This sets the client name in the ORGB SDK server to the name provided.

This lets you identify which programs are currently connected.

controller_count()[source]

This returns the count of active controllers in OpenRGB.

controller_data(device_id=0)[source]

This returns an ORGBDevice constructed from the response given by the SDK Server, with device_id being the identifier for each device.

devices()[source]

This provides a generator for iterating though all the devices OpenRGB can find.

This is the recommended interface for finding devices.

resize_zone(zone_id, new_size, device_id=0)[source]
set_custom_mode(device_id=0)[source]

This calls set_custom_mode in the RGBController, which in most cases sets the active mode to 0.

set_update_mode(mode, device_id=0, speed=None, direction=None, color_mode=None)[source]

This is the protocol level way of setting the mode.

mode can either be the mode id, or the ORGBMode object, though in the second case it’s preferable to use it directly to set the active mode.

update_leds(color_collection, device_id=0)[source]

This is the protocol level function for setting multiple LEDs at once.

update_single_led(led, color, device_id=0)[source]

This is the protocol level function for setting a single LED.

update_zone_leds(zone_id, color_collection, device_id=0)[source]

This is the protocol level function for setting a zones LEDs.

ORGBDevice

ORGBDevice is the class which is used to understand the device response from the SDK Server. You shouldn’t need to every directly instantiate this class, but reading it’s attributes is needed to get information on a device.

class openrgb.ORGBDevice(data, device_id=0, owner=None)[source]

ORGB is used to read device responses from the OpenRGB SDK server

Attribute id:Device ID.
Attribute type:Device Type.
Attribute name:Name of the device
Attribute desc:Description of the device
Attribute version:
 Device Version
Attribute serial:
 Device Serial
Attribute location:
 Device location
Attribute active_mode:
 Devices Active Mode
Attribute modes:
 List of modes
Attribute zones:
 List of zones
Attribute leds:List of LEDs
Attribute colors:
 List of colors
set(colors, interpolate=False)[source]

This will set the LEDs belong to this device to the color(s) in colors.

If provided with a single tuple, it will set all LEDs in the device to that color.

If provided a list, with interpolate set to false (by default), it will set the leds to the colors in order of the colors.

e.g. with a device with 4 leds, and colors set to [(1,1,1), (2,2,2)] only LED 1 and 2 will be changed, not LED 3 or 4.

However, if interpolate is provided it will map all the leds to the range of values in colors

Interpolate has no effect if not given a list.

ORGBMode

class openrgb.ORGBMode(idx, name, value, flags, speed_min, speed_max, colors_min, colors_max, speed, direction, color_mode, colors, owner=None)[source]
Attribute speed:
 The speed that effects this mode
Attribute direction:
 The direction, if relevant to this mode.
Attribute color_mode:
 Color mode, if relevant.
active()[source]

This makes this mode active on the device it is relevant to.

ORGBZone

class openrgb.ORGBZone(idx, name, zonetype, leds_min, leds_max, leds_count, owner=None)[source]
set(colors, interpolate=False)[source]

This will set the LEDs belong to this zone to the color(s) in colors.

If provided with a single tuple, it will set all LEDs in the zone to that color.

If provided a list, with interpolate set to false (by default), it will set the leds to the colors in order of the colors.

e.g. with a zone with 4 leds, and colors set to [(1,1,1), (2,2,2)] only LED 1 and 2 will be changed, not LED 3 or 4.

However, if interpolate is provided it will map all the leds to the range of values in colors

Interpolate has no effect if not given a list.

ORGBLED

class openrgb.ORGBLED(idx, name, value, owner=None)[source]

ORGBLED is a class that contains a reference to a Single LED. This is constructed by ORGBDevice and shouldn’t ever need to be created manually.

It does however provide the LED Name, current value, and a reference to the device that owns it.

Attribute id:LED ID
Attribute name:String representing the LEDS name
Attribute value:
 The value of the led.
Attribute owner:
 A reference to the device that owns this LED.
set(color)[source]

This function will change the color of the LED to color, represented as a tuple of RGB values.

ORGBDeviceTypes

This is an enumerator for all the possible device types.

class openrgb.ORGBDeviceType[source]

An enumeration.

COOLER = 3
DRAM = 1
GPU = 2
HEADSET = 8
KEYBOARD = 5
LEDSTRIP = 4
MOTHERBOARD = 0
MOUSE = 6
MOUSEMAT = 7
UNKNOWN = 9