class Boblight - guddimon-/boblight-client GitHub Wiki
Boblight(host="", port=19333, priority=255)
- Instantiate the object Boblight. If the host is given, it is tried to open the connection to boblightd. Note that
priority=255
means that this client is never used.
connect(host, port=1933)
- Connect to the given host of boblightd. With connecting to boblightd, the client gets the usual information about all lights.
setColor(red, green, blue)
- Set the color of all lights to a new value.
setPriority(priority)
- Set the priority to a new value. Useful together with
ping()
to make sure the clients information is used.
disconnect()
- Disconnect from boblightd.
setSpeed(speed)
- Set new speed value for all lights. Integers in the range [0, 100] are allowed.
setInterpolation(interpolation)
- Enable/disable interpolation for all lights.
sync()
- Manually tell boblightd to use values after bulk settings. This must be enabled in the servers configuration.
getLightsCount()
- Get the number of lights driven by boblightd.
getLight()
- Get the list with all lights. To get light number 10, you have to use
getlight()[9]
. To process all lights in a loop you may usefor l in getlight()
.
ping()
- Ping boblightd. The result is as follows:
ping 1
: at least one light of the clients output is usedping 0
: no light of the clients output is used
host
:
- String that can contain either a hostname or an IP.
port
:
- If nothing is given, the default port (19333) is taken.
priority
:
- The clients priority. If nothing is given, the lowest priority is used which means the clients output is never used by boblightd.
red
, green
, blue
:
- The value of each lights colors (RGB). At the moment only float values in the range [0, 1] are supported.
interpolation
:
- Boolean value True/False is allowed.