Control USB connected LED lights, like a human.
Project description
BusyLight for Humans™ gives you control of USB attached LED lights from a variety of vendors. Lights can be controlled via the command-line, using a HTTP API or imported directly into your own python projects. Need a light to let you know when a host is down, or when the dog wants out? How about a light that indicates "do not disturb"?
The possibilities are literally endless.
Back to Front, Left to Right
BlyncLight, BlyncLight Plus, Busylight
Blink(1), Flag, BlinkStick
Features
- Control Lights via Command-Line
- Control Lights via Web API
- Supports Lights from Five Vendors
- Agile Innovations BlinkStick
- Embrava Blynclight
- ThingM Blink1
- Kuando BusyLight
- Luxafor Flag
- Supported on MacOS, Linux, probably Windows and BSD too!
- Tested extensively on Raspberry Pi 3b+, Zero W and 4
Basic Install
$ python3 -m pip install busylight-for-humans
Web API Install
Install uvicorn
and FastAPI
in addition to busylight
:
$ python3 -m pip install busylight-for-humans[webapi]
Command-Line Examples
$ busylight on # light turns on green
$ busylight on red # now it's shining a friendly red
$ busylight on 0xff0000 # still red
$ busylight on #00ff00 # now it's blue!
$ busylight blink # it's slowly blinking on and off with a red color
$ busylight blink green fast # blinking faster green and off
$ busylight --all on # turn all lights on green
$ busylight --all off # turn all lights off
HTTP API Examples
First start the busylight
API server:
$ busylight serve
INFO: Started server process [20189]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8888 (Press CTRL+C to quit)
The API is fully documented and available @ https://localhost:8888/redoc
Now you can use the web API endpoints which return JSON payloads:
$ curl http://localhost:8888/1/lights
$ curl http://localhost:8888/1/lights/on
$ curl http://localhost:8888/1/lights/off
$ curl http://localhost:8888/1/light/0/on/purple
$ curl http://localhost:8888/1/light/0/off
$ curl http://localhost:8888/1/lights/on
$ curl http://localhost:8888/1/lights/off
$ curl http://localhost:8888/1/lights/rainbow
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for busylight-for-humans-0.7.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e31e158d50cdeaa8328b43e7dcec2bb88d49d6bb24ad6d3445758c1dbea5987 |
|
MD5 | d8e17967d2f011a7f84446a6263a98e7 |
|
BLAKE2b-256 | ca3a0bfb7fd95efd7fd5b35ac2b4406a93127359513173392c2806e1a5c8a6df |
Hashes for busylight_for_humans-0.7.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1238777976faab010dd09883b8c16d60774cf3b3e1d6917ce8c4c6e301d9368 |
|
MD5 | 35c9cc30309d19e98e677127f3fa49b6 |
|
BLAKE2b-256 | 435ab8427190ba91b4768638fc9ca878f0a198e0f90e0b71a7afa83c372bb8c4 |