Not mature yet project of RGB lights that can be controlled from your phone or local terminal.
There are several clients available.
TUI application written in rust created by @mtvrsh.
CLI application written in python.
Method | Endpoint | Usage | Returns |
---|---|---|---|
GET | /led |
Get LED status | status |
GET | /led/on |
Get LED power status | true if LED power is ON, false otherwise |
PUT | /led/on |
Power on LEDs | |
GET | /led/off |
Get LED power status | true if LED power is OFF, false otherwise |
PUT | /led/off |
Power off LEDs | |
GET | /led/color |
Get LED color | color |
PUT | /led/color/{value} |
Set LED color | |
GET | /led/brightness |
Get LED brightness | brightness |
PUT | /led/brightness/{value} |
Set LED brightness |
Make sure you have just
, python
and pip
installed. From api directory:
- Install dependencies
just
- Flash MicroPython on your ESP8266 board
# Your board should be accessible from /dev/ttyUSB0
just flash <your-firmware-release.bin>
- Install API
just sync
- Reboot the board
Request
No parameters needed.
Response
On success, 200 OK
and color
object.
Example
Request
curl http://$DEVICE_IP/led/color
Response 200 OK
{
"color": "#000000"
}
Request
Value
as hex color without leading #
.
Response
On success, 200 OK
.
On invalid input, 400 Bad Request
with message object.
Example
Request
curl -X PUT http://$DEVICE_IP/led/color/5a1010
Response 200 OK
Request
No parameters needed.
Response
On success, 200 OK
and brightness
object.
Example
Request
curl http://$DEVICE_IP/led/brightness
Response 200 OK
{
"brightness": 1.0
}
Request
Value
as number from 0
to 1
.
Response
On success, 200 OK
.
On invalid input, 400 Bad Request
with message object.
Example
Request
curl -X PUT http://$DEVICE_IP/led/brightness/0.5
Response 200 OK
Key | Value type | Value description |
---|---|---|
on | boolean | Power state |
color | string | Hex color |
brightness | float | Number from 0 to 1 |
Key | Value type | Value description |
---|---|---|
color | string | Hex color |
Key | Value type | Value description |
---|---|---|
brightness | float | Number from 0 to 1 |
Key | Value type | Value description |
---|---|---|
message | string | Activities description |