Skip to content

Light Scripting Help

Alex Cordonnier edited this page May 11, 2015 · 3 revisions

This page will provide simple instructions for using the scripting interface to control the lights.

Hello World example

This example script turns all lights red.

for light in lights:
    lights[light].send_rgb(255, 0, 0)

API

NOTE: The API is currently in flux and may change drastically.

Types

Light

Public methods
send_rgb(red, green, blue)

This function sets the light to the specified red, green, and blue values. These can vary from 0 (off) to 255 (on).

Public attributes
pos

A tuple (x, y, z) that specifies the virtual coordinates of the light. The coordinates are based on the light number.

rgb

A tuple (r, g, b) of the current RGB value of the light.

Global objects

lights

A dictionary of currently connected lights. It maps light numbers to Light objects.

Global functions

test_rgb()

This function turns on the red, green, and blue channels of each light for 1 second sequentially.

cycle_hue()

This function cycles the hue of all connected lights.