Skip to main content

A python module to interact with Q-Light warning lights

Project description


A python interface for Q-Light warning light towers. Includes both a module
which can be included as well as a command line utility suitable for one-shot

Before submutting a Pull request
Make sure that your code meets the style and quality guidelines within the


This code may or may not work on a Mac... if you can verify this, or provide a
method to get it working on a Mac, please let me know.
It has only ever been tested on Ubuntu (15.04).

If more than one lamp is connected to the system, there is no way to determine
which one you are addressing. Without a second lamp to test with, I cannot
reliably add this functionality.

There is no way to poll the light for it's current state that I can determine.
This appears to be a limitation of the Q-Lights themselves.

The code must be run as root to access the USB devices. The exception is
systems that use udev. For those, you can place the included
udev/80-q-light.rules into /etc/udev/rules.d and then replug the device. As
long as your user account is in the plugdev group, you will then be able to
control the light as a non-root user.

usage: pyqlight [-h] [-r [STATE]] [-y [STATE]] [-g [STATE]] [-b [STATE]]
[-w [STATE]] [-a [STATE]] [-t [TONE]] [-d [DURATION]]

control a Q-Light warning tower. All lamps should have red, yellow and green
lights available. Blue and white lights may or may not be available depending
on exact model.

optional arguments:
-h, --help show this help message and exit

Light Controls:
Valid states are "off", "on", "blink", "pass"

-r [STATE], --red [STATE]
Desired state of red lamp. (default: pass)
-y [STATE], --yellow [STATE]
Desired state of yellow lamp. (default: pass)
-g [STATE], --green [STATE]
Desired state of green lamp. (default: pass)
-b [STATE], --blue [STATE]
Desired state of blue lamp. (default: pass)
-w [STATE], --white [STATE]
Desired state of white lamp. (default: pass)
-a [STATE], --all-lights [STATE]
State of all lamps. (default: None)

Tone Controls:
valid tone options are "off", "tone_1", "tone_2", "tone_3", "tone_4",
"tone_5", "pass"

-t [TONE], --tone [TONE]
Desired tone to play. (default: pass)
-d [DURATION], --duration [DURATION]
Duration to play tone (in ms). (default: 0)

Written by Chris Jowett,

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyqlight, version 1.0.1
Filename, size & hash File type Python version Upload date
pyqlight-1.0.1-py2-none-any.whl (8.6 kB) View hashes Wheel py2
pyqlight-1.0.1.tar.gz (6.1 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page