Compare commits

..

3 Commits

Author SHA1 Message Date
iGoX cb5a762c2f Rework README.md 2026-03-26 10:44:39 +01:00
iGoX eca92a280e Rework README.md 2026-03-26 10:44:23 +01:00
iGoX 782db6f039 Migrate Stream Deck plugin into its own repository 2026-03-26 10:36:45 +01:00
4 changed files with 19 additions and 117 deletions
+9 -63
View File
@@ -165,7 +165,7 @@ class LedController:
async def stop(self):
await self.sendCommand({"type": "off"})
def getStatus(self):
def get_state(self):
if self.blinking and self.blinkDuration > 0:
elapsed = time.ticks_diff(time.ticks_ms(), self.blinkStart) / 1000
remains = max(0.0, self.blinkDuration - elapsed)
@@ -258,16 +258,7 @@ async def setColor(request):
await led.set_color((r, g, b), brightness)
status = await led.get_status()
state = led.getStatus()
return {'status': state["status"],
'color': state["color"],
'brightness': state["brightness"],
'isblinking': state["isblinking"],
'blinkParameters': {
'frequency': state["frequency"],
'duration': state["duration"],
'remains': state["remains"]}
}
return {'status': status}
@app.get('/api/color')
@@ -279,16 +270,7 @@ async def getColor(request):
@app.get('/api/status')
async def getStatus(request):
status = await led.get_status()
state = led.getStatus()
return {'status': state["status"],
'color': state["color"],
'brightness': state["brightness"],
'isblinking': state["isblinking"],
'blinkParameters': {
'frequency': state["frequency"],
'duration': state["duration"],
'remains': state["remains"]}
}
return {'status': status}
@app.route('/api/status/<status>', methods=['GET', 'POST'])
@@ -299,16 +281,7 @@ async def setStatus(request, status):
return {'error': 'unknown status'}, 404
status = await led.get_status()
state = led.getStatus()
return {'status': state["status"],
'color': state["color"],
'brightness': state["brightness"],
'isblinking': state["isblinking"],
'blinkParameters': {
'frequency': state["frequency"],
'duration': state["duration"],
'remains': state["remains"]}
}
return {'status': status}
@app.post('/api/blink')
@@ -327,21 +300,12 @@ async def setBlink(request):
await led.blink(freq, duration)
state = led.getStatus()
return {'status': state["status"],
'color': state["color"],
'brightness': state["brightness"],
'isblinking': state["isblinking"],
'blinkParameters': {
'frequency': state["frequency"],
'duration': state["duration"],
'remains': state["remains"]}
}
return {'status': 'blinking', 'frequency': freq, 'duration': duration}
@app.get('/api/blink')
async def getBlinkStatus(request):
state = led.getStatus()
async def getBlink(request):
state = led.get_state()
return {
'isblinking': state["isblinking"],
'frequency': state["frequency"],
@@ -355,16 +319,7 @@ async def blinkStop(request):
await led.stop()
await led.set_status(led.previousStatus)
status = await led.get_status()
state = led.getStatus()
return {'status': state["status"],
'color': state["color"],
'brightness': state["brightness"],
'isblinking': state["isblinking"],
'blinkParameters': {
'frequency': state["frequency"],
'duration': state["duration"],
'remains': state["remains"]}
}
return {'status': status}
@app.get('/api/debug')
@@ -397,16 +352,7 @@ async def mutedeckWebhook(request):
else:
await led.set_status('available')
state = led.getStatus()
return {'status': state["status"],
'color': state["color"],
'brightness': state["brightness"],
'isblinking': state["isblinking"],
'blinkParameters': {
'frequency': state["frequency"],
'duration': state["duration"],
'remains': state["remains"]}
}
return {'status': led.status}
@app.post('/shutdown')
+8 -52
View File
@@ -21,13 +21,9 @@ A cheap, simple to build, nice looking and portable DIY **Busy Light**.
It comes with a with a simplistic but neat **Web UI** and a simple (but hopefully convenient) **Rest API**.
| Controlled by Stream Deck with REST API | Light roll |
| ------------------------------------------------------------- | ------------------------------------------------- |
| --- | --- |
| ![busylight and stream deck](resources/images/busylight.jpg) | ![busylight roll](resources/images/busylight.gif) |
---
![show case](resources/videos/busylight-showoff.webp)
# Web UI
A very simplistic but neat UI is available on port `80` (thanks @nicolaeser).
@@ -43,12 +39,10 @@ You can try to reach the web UI @ <http://igox-busylight.local>.
[BusyLight Buddy](https://code.igox.org/iGoX/busylight-buddy) is a free, open-source multiplatform companion app to control your BusyLight from your phone or computer — no browser needed.
Available for **Android**, **macOS** and **Windows**.
Available for **iOS**, **iPadOS**, **Android**, **macOS**, and **Windows**.
It features quick status presets, a custom color picker with saveable presets, a brightness slider, and background polling to keep the UI in sync with the device.
![busylight-buddy-screenshot](resources/images/buddy-ios-screenshot-main.png)
# Stream Deck plug-in
You can download the Stream Deck plugin to control your BusyLight:
@@ -73,8 +67,8 @@ Or directly from **[busyLight-streamdeck-pluing](https://code.igox.org/iGoX/busy
| /api/status/busy | POST / GET | n/a | Set the BusyLight in `busy` mode. Red color. Return a `status` object. |
| /api/status/off | POST / GET | n/a | Shutdown the BusyLight. Return a `status` object. |
| /api/status | GET | n/a | Retreive the current BusyLight status. Return a `status` object. |
| /api/blink | POST | `blinkParam` JSON object | Make the BusyLight blink. Preserves current color, status and brightness. Return a `status` object. |
| /api/blink | GET | n/a | Retrieve the current BusyLight blink status. Return a `blinkStatus` object. |
| /api/blink | POST | `blink` JSON object | Make the BusyLight blink. Preserves current color, status and brightness. Return a `status` object. |
| /api/blink | GET | n/a | Retrieve the current BusyLight blink status. Return a `blink` object. |
| /api/blink/stop | POST | n/a | Stop the BusyLight blinking and restore previous state. Return a `status` object. |
| /api/debug | GET | n/a | Retreive the full BusyLight status. |
@@ -106,19 +100,7 @@ Or directly from **[busyLight-streamdeck-pluing](https://code.igox.org/iGoX/busy
`brightness`: LED brightness | float | [0.0 .. 1.0]
### `blinkParam` object
```json
{
"frequency": 2,
"duration": 5.0,
```
`frequency`: blink frequency | integer | Hz
`duration`: total blink duration | float | seconds | 0 = endless
### `blinkStatus` object
### `blink` object
```json
{
@@ -138,37 +120,11 @@ Or directly from **[busyLight-streamdeck-pluing](https://code.igox.org/iGoX/busy
```json
{
"status": "<STATUS>",
"color": {
"r": 255,
"g": 0,
"b": 110
},
"brightness": 0.1
"isBlinkning": false,
"blinkParameters": {
"frequency": 2,
"duration": 5.0,
"remains": 3.2
}
"status": "<STATUS>"
}
```
`<STATUS>` : `on` | `off` | `available` | `away` | `busy` | `colored`
`color`:
- `r`: RED color | integer | [0 .. 255]
- `g`: GREEN color | integer | [0 .. 255]
- `b`: BLUE color | integer | [0 .. 255]
`brightness`: LED brightness (optional) | float | [0.0 .. 1.0]
`isblinking`: whether the BusyLight is currently blinking | boolean
`blinkParameters`
- `frequency`: blink frequency | integer | Hz
- `duration`: total blink duration | float | seconds | 0 = endless
- `remains`: remaining blink time | float | seconds | 0 if endless
`<STATUS>` : `on` | `off` | `available` | `away` | `busy` | `colored` | `blinking`
# MuteDeck integration
@@ -238,7 +194,7 @@ You can see a final assembly image [here](3D-files-to-print/README.md).
## Microdot
<https://microdot.readthedocs.io>
<https://microdot.readthedocs.io/en/latest/index.html>
## JSColor
Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB