Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f64ceeb477 | |||
| 4efb3ad581 | |||
| 60d179cf4a | |||
| f2da89b184 | |||
| b0903c7610 | |||
| 1a3bec9e85 | |||
| 69bb4aa6dc |
@@ -86,6 +86,7 @@ class LedController:
|
|||||||
|
|
||||||
async def _off(self):
|
async def _off(self):
|
||||||
self.color = (0, 0, 0)
|
self.color = (0, 0, 0)
|
||||||
|
self.previousStatus = self.status
|
||||||
self.status = "off"
|
self.status = "off"
|
||||||
self._write(self.color)
|
self._write(self.color)
|
||||||
|
|
||||||
@@ -121,7 +122,7 @@ class LedController:
|
|||||||
self.status = self.previousStatus
|
self.status = self.previousStatus
|
||||||
self._write(self.color)
|
self._write(self.color)
|
||||||
|
|
||||||
async def send(self, cmd):
|
async def sendCommand(self, cmd):
|
||||||
self._cmd = cmd
|
self._cmd = cmd
|
||||||
self._flag.set()
|
self._flag.set()
|
||||||
|
|
||||||
@@ -129,8 +130,7 @@ class LedController:
|
|||||||
async def set_color(self, color, brightness=None):
|
async def set_color(self, color, brightness=None):
|
||||||
if brightness is not None:
|
if brightness is not None:
|
||||||
self.brightness = brightness
|
self.brightness = brightness
|
||||||
|
await self.sendCommand({
|
||||||
await self.send({
|
|
||||||
"type": "solid",
|
"type": "solid",
|
||||||
"color": color
|
"color": color
|
||||||
})
|
})
|
||||||
@@ -142,16 +142,19 @@ class LedController:
|
|||||||
if color is None:
|
if color is None:
|
||||||
raise ValueError("invalid status")
|
raise ValueError("invalid status")
|
||||||
|
|
||||||
await self.send({
|
await self.sendCommand({
|
||||||
"type": "solid",
|
"type": "solid",
|
||||||
"color": color,
|
"color": color,
|
||||||
"status": status.lower()
|
"status": status.lower()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
async def get_status(self):
|
||||||
|
return self.status
|
||||||
|
|
||||||
async def blink(self, frequency, duration):
|
async def blink(self, frequency, duration):
|
||||||
self.previousStatus = self.status
|
self.previousStatus = self.status
|
||||||
|
|
||||||
await self.send({
|
await self.sendCommand({
|
||||||
"type": "blink",
|
"type": "blink",
|
||||||
"color": self.color,
|
"color": self.color,
|
||||||
"frequency": frequency,
|
"frequency": frequency,
|
||||||
@@ -160,9 +163,9 @@ class LedController:
|
|||||||
})
|
})
|
||||||
|
|
||||||
async def stop(self):
|
async def stop(self):
|
||||||
await self.send({"type": "off"})
|
await self.sendCommand({"type": "off"})
|
||||||
|
|
||||||
def get_state(self):
|
def getStatus(self):
|
||||||
if self.blinking and self.blinkDuration > 0:
|
if self.blinking and self.blinkDuration > 0:
|
||||||
elapsed = time.ticks_diff(time.ticks_ms(), self.blinkStart) / 1000
|
elapsed = time.ticks_diff(time.ticks_ms(), self.blinkStart) / 1000
|
||||||
remains = max(0.0, self.blinkDuration - elapsed)
|
remains = max(0.0, self.blinkDuration - elapsed)
|
||||||
@@ -226,7 +229,6 @@ async def setBrightness(request):
|
|||||||
await led.set_color(current_color, brightness)
|
await led.set_color(current_color, brightness)
|
||||||
|
|
||||||
led.status = current_status
|
led.status = current_status
|
||||||
|
|
||||||
return {'brightness': led.brightness}
|
return {'brightness': led.brightness}
|
||||||
|
|
||||||
|
|
||||||
@@ -235,6 +237,7 @@ async def setColor(request):
|
|||||||
r = request.json.get("r")
|
r = request.json.get("r")
|
||||||
g = request.json.get("g")
|
g = request.json.get("g")
|
||||||
b = request.json.get("b")
|
b = request.json.get("b")
|
||||||
|
brightness = request.json.get("brightness")
|
||||||
|
|
||||||
if r is None or g is None or b is None:
|
if r is None or g is None or b is None:
|
||||||
return {'error': 'missing color'}, 400
|
return {'error': 'missing color'}, 400
|
||||||
@@ -245,11 +248,26 @@ async def setColor(request):
|
|||||||
if not (0 <= r <= 255 and 0 <= g <= 255 and 0 <= b <= 255):
|
if not (0 <= r <= 255 and 0 <= g <= 255 and 0 <= b <= 255):
|
||||||
return {'error': 'color out of bound'}, 400
|
return {'error': 'color out of bound'}, 400
|
||||||
|
|
||||||
brightness = request.json.get("brightness")
|
if brightness is not None:
|
||||||
|
if not isinstance(brightness, (int, float)):
|
||||||
|
return {'error': 'wrong brightness type'}, 400
|
||||||
|
|
||||||
|
if brightness < 0 or brightness > 1:
|
||||||
|
return {'error': 'brightness out of bound'}, 400
|
||||||
|
|
||||||
await led.set_color((r, g, b), brightness)
|
await led.set_color((r, g, b), brightness)
|
||||||
|
status = await led.get_status()
|
||||||
|
|
||||||
return {'status': led.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"]}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@app.get('/api/color')
|
@app.get('/api/color')
|
||||||
@@ -260,7 +278,17 @@ async def getColor(request):
|
|||||||
|
|
||||||
@app.get('/api/status')
|
@app.get('/api/status')
|
||||||
async def getStatus(request):
|
async def getStatus(request):
|
||||||
return {'status': led.status}
|
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"]}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/status/<status>', methods=['GET', 'POST'])
|
@app.route('/api/status/<status>', methods=['GET', 'POST'])
|
||||||
@@ -270,7 +298,17 @@ async def setStatus(request, status):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
return {'error': 'unknown status'}, 404
|
return {'error': 'unknown status'}, 404
|
||||||
|
|
||||||
return {'status': led.status}
|
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"]}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@app.post('/api/blink')
|
@app.post('/api/blink')
|
||||||
@@ -289,12 +327,21 @@ async def setBlink(request):
|
|||||||
|
|
||||||
await led.blink(freq, duration)
|
await led.blink(freq, duration)
|
||||||
|
|
||||||
return {'status': 'blinking', 'frequency': freq, 'duration': 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"]}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@app.get('/api/blink')
|
@app.get('/api/blink')
|
||||||
async def getBlink(request):
|
async def getBlinkStatus(request):
|
||||||
state = led.get_state()
|
state = led.getStatus()
|
||||||
return {
|
return {
|
||||||
'isblinking': state["isblinking"],
|
'isblinking': state["isblinking"],
|
||||||
'frequency': state["frequency"],
|
'frequency': state["frequency"],
|
||||||
@@ -307,7 +354,17 @@ async def getBlink(request):
|
|||||||
async def blinkStop(request):
|
async def blinkStop(request):
|
||||||
await led.stop()
|
await led.stop()
|
||||||
await led.set_status(led.previousStatus)
|
await led.set_status(led.previousStatus)
|
||||||
return {'status': led.status}
|
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"]}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@app.get('/api/debug')
|
@app.get('/api/debug')
|
||||||
@@ -340,7 +397,16 @@ async def mutedeckWebhook(request):
|
|||||||
else:
|
else:
|
||||||
await led.set_status('available')
|
await led.set_status('available')
|
||||||
|
|
||||||
return {'status': led.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"]}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@app.post('/shutdown')
|
@app.post('/shutdown')
|
||||||
@@ -367,4 +433,4 @@ async def main():
|
|||||||
await app.start_server(port=80)
|
await app.start_server(port=80)
|
||||||
|
|
||||||
|
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
|||||||
@@ -20,9 +20,13 @@ 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**.
|
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 |
|
| Controlled by Stream Deck with REST API | Light roll |
|
||||||
| --- | --- |
|
| ------------------------------------------------------------- | ------------------------------------------------- |
|
||||||
|  |  |
|
|  |  |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
# Web UI
|
# Web UI
|
||||||
|
|
||||||
@@ -33,21 +37,25 @@ You can try to reach the web UI @ <http://igox-busylight.local>.
|
|||||||
|
|
||||||
| What an neat UI ! 😄 |
|
| What an neat UI ! 😄 |
|
||||||
| --- |
|
| --- |
|
||||||
|  |
|
|  |
|
||||||
|
|
||||||
# BusyLight Buddy companion app
|
# BusyLight Buddy companion app
|
||||||
|
|
||||||
[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.
|
[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 **iOS**, **iPadOS**, **Android**, **macOS**, and **Windows**.
|
Available for **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.
|
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.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
# Stream Deck plug-in
|
# Stream Deck plug-in
|
||||||
|
|
||||||
You can download a Stream Deck plugin to control your BusyLight:
|
You can download the Stream Deck plugin to control your BusyLight:
|
||||||
|
|
||||||
Or directly from [here](streamdeck-plugin/README.md).
|
[](https://marketplace.elgato.com/product/igox-busylight-7448a0be-6dd6-4711-ba0d-86c52b9075b9)
|
||||||
|
|
||||||
|
Or directly from **[busyLight-streamdeck-pluing](https://code.igox.org/iGoX/busylight-streamdeck-plugin)** repository.
|
||||||
|
|
||||||
# BusyLight API
|
# BusyLight API
|
||||||
|
|
||||||
@@ -65,8 +73,8 @@ Or directly from [here](streamdeck-plugin/README.md).
|
|||||||
| /api/status/busy | POST / GET | n/a | Set the BusyLight in `busy` mode. Red color. Return a `status` object. |
|
| /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/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/status | GET | n/a | Retreive the current BusyLight status. Return a `status` object. |
|
||||||
| /api/blink | POST | `blink` JSON object | Make the BusyLight blink. Preserves current color, status and brightness. 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 `blink` object. |
|
| /api/blink | GET | n/a | Retrieve the current BusyLight blink status. Return a `blinkStatus` object. |
|
||||||
| /api/blink/stop | POST | n/a | Stop the BusyLight blinking and restore previous state. Return a `status` 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. |
|
| /api/debug | GET | n/a | Retreive the full BusyLight status. |
|
||||||
|
|
||||||
@@ -98,7 +106,19 @@ Or directly from [here](streamdeck-plugin/README.md).
|
|||||||
|
|
||||||
`brightness`: LED brightness | float | [0.0 .. 1.0]
|
`brightness`: LED brightness | float | [0.0 .. 1.0]
|
||||||
|
|
||||||
### `blink` object
|
### `blinkParam` object
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"frequency": 2,
|
||||||
|
"duration": 5.0,
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
`frequency`: blink frequency | integer | Hz
|
||||||
|
`duration`: total blink duration | float | seconds | 0 = endless
|
||||||
|
|
||||||
|
### `blinkStatus` object
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@@ -118,11 +138,37 @@ Or directly from [here](streamdeck-plugin/README.md).
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"status": "<STATUS>"
|
"status": "<STATUS>",
|
||||||
|
"color": {
|
||||||
|
"r": 255,
|
||||||
|
"g": 0,
|
||||||
|
"b": 110
|
||||||
|
},
|
||||||
|
"brightness": 0.1
|
||||||
|
"isBlinkning": false,
|
||||||
|
"blinkParameters": {
|
||||||
|
"frequency": 2,
|
||||||
|
"duration": 5.0,
|
||||||
|
"remains": 3.2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
`<STATUS>` : `on` | `off` | `available` | `away` | `busy` | `colored` | `blinking`
|
`<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
|
||||||
|
|
||||||
# MuteDeck integration
|
# MuteDeck integration
|
||||||
|
|
||||||
@@ -137,7 +183,7 @@ It will automatically switch to the BusyLight in:
|
|||||||
|
|
||||||
| MuteDeck Configuration |
|
| MuteDeck Configuration |
|
||||||
| --- |
|
| --- |
|
||||||
|  |
|
|  |
|
||||||
|
|
||||||
# Electronic parts
|
# Electronic parts
|
||||||
|
|
||||||
@@ -156,7 +202,7 @@ It will automatically switch to the BusyLight in:
|
|||||||
|
|
||||||
| Tools > Manage plug-ins | lib selection |
|
| Tools > Manage plug-ins | lib selection |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
|  |  |
|
|  |  |
|
||||||
|
|
||||||
> ⚠️ **Compatibility note:** MicroPython v1.27 is **not compatible** with Microdot due to breaking changes in the underlying ESP-IDF v5.5. Use MicroPython **v1.24.1** with Microdot **v2.0.6**.
|
> ⚠️ **Compatibility note:** MicroPython v1.27 is **not compatible** with Microdot due to breaking changes in the underlying ESP-IDF v5.5. Use MicroPython **v1.24.1** with Microdot **v2.0.6**.
|
||||||
|
|
||||||
@@ -164,7 +210,7 @@ It will automatically switch to the BusyLight in:
|
|||||||
|
|
||||||
**(4)** Copy the content of [ESP32](ESP32) folder with the modified `boot.py` file to the root of your ESP32 file system. Again, can easily be done using [Thonny](https://thonny.org):
|
**(4)** Copy the content of [ESP32](ESP32) folder with the modified `boot.py` file to the root of your ESP32 file system. Again, can easily be done using [Thonny](https://thonny.org):
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
**Done!**
|
**Done!**
|
||||||
|
|
||||||
@@ -176,7 +222,7 @@ All the required 3D files (STLs and f3d project) to 3D print the enclosure are a
|
|||||||
|
|
||||||
# Wiring / Soldering
|
# Wiring / Soldering
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
You can see a final assembly image [here](3D-files-to-print/README.md).
|
You can see a final assembly image [here](3D-files-to-print/README.md).
|
||||||
|
|
||||||
@@ -192,7 +238,7 @@ You can see a final assembly image [here](3D-files-to-print/README.md).
|
|||||||
|
|
||||||
## Microdot
|
## Microdot
|
||||||
|
|
||||||
<https://microdot.readthedocs.io/en/latest/index.html>
|
<https://microdot.readthedocs.io>
|
||||||
|
|
||||||
## JSColor
|
## JSColor
|
||||||
|
|
||||||
|
|||||||
|
After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 195 KiB After Width: | Height: | Size: 195 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.2 MiB |
|
After Width: | Height: | Size: 1.1 MiB |
@@ -1,103 +0,0 @@
|
|||||||
# BusyLight Stream Deck plugin - Release notes
|
|
||||||
|
|
||||||
## Version 0.3.1.0 (2024-01-06)
|
|
||||||
|
|
||||||
### Download
|
|
||||||
|
|
||||||
[org.igox.busylight.v0.3.1.0.streamDeckPlugin](download/org.igox.busylight.v0.3.1.0.streamDeckPlugin)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- None added
|
|
||||||
|
|
||||||
### Enhancements
|
|
||||||
|
|
||||||
- Add colored button for "Set color" action.
|
|
||||||
- Add colored button for "Set brightness" action.
|
|
||||||
- Update plugin and plugin category icons
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- None.
|
|
||||||
|
|
||||||
### Bugs & known limitations
|
|
||||||
|
|
||||||
- None known at publication time.
|
|
||||||
|
|
||||||
### Screenshot
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Version 0.3.0.0 (2024-01-06)
|
|
||||||
|
|
||||||
### Download
|
|
||||||
|
|
||||||
[org.igox.busylight.v0.3.0.0.streamDeckPlugin](download/org.igox.busylight.v0.3.0.0.streamDeckPlugin)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- None added
|
|
||||||
|
|
||||||
### Enhancements
|
|
||||||
|
|
||||||
- Rework icons to comply with plugin guidelines for Elgato Marketplace
|
|
||||||
- Combine the 3 "status" actions into a single action and having the status be selected with a dropdown
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- None.
|
|
||||||
|
|
||||||
### Bugs & known limitations
|
|
||||||
|
|
||||||
- None known at publication time.
|
|
||||||
|
|
||||||
### Screenshot
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Version 0.2.0.0 (2024-12-28)
|
|
||||||
|
|
||||||
### Download
|
|
||||||
|
|
||||||
[org.igox.busylight.v0.2.0.0.streamDeckPlugin](download/org.igox.busylight.v0.2.0.0.streamDeckPlugin)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- Add the capability to set the color diplayed by BusyLigh LEDs.
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- None.
|
|
||||||
|
|
||||||
### Bugs & known limitations
|
|
||||||
|
|
||||||
- None known at publication time.
|
|
||||||
|
|
||||||
### Screenshot
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
## Version 0.1.0.0 (2024-12-28)
|
|
||||||
|
|
||||||
### Download
|
|
||||||
|
|
||||||
[org.igox.busylight.v0.1.0.0.streamDeckPlugin](download/org.igox.busylight.v0.1.0.0.streamDeckPlugin)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- Quick action buttons to set the BusyLight status (Available: green, Away: yellow, Busy: red).
|
|
||||||
- Quick action button to turn off the BusyLight.
|
|
||||||
- Button to set the BusyLight brightness.
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- None: initial version of the plugin.
|
|
||||||
|
|
||||||
### Bugs & known limitations
|
|
||||||
|
|
||||||
- None known at publication time.
|
|
||||||
|
|
||||||
### Screenshot
|
|
||||||
|
|
||||||

|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
# Node.js
|
|
||||||
node_modules/
|
|
||||||
|
|
||||||
# Stream Deck files
|
|
||||||
*.sdPlugin/bin
|
|
||||||
*.sdPlugin/logs
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "Attach to Plugin",
|
|
||||||
"type": "node",
|
|
||||||
"request": "attach",
|
|
||||||
"processId": "${command:PickProcess}",
|
|
||||||
"outFiles": [
|
|
||||||
"${workspaceFolder}/bin/**/*.js"
|
|
||||||
],
|
|
||||||
"resolveSourceMapLocations": [
|
|
||||||
"${workspaceFolder}/**"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
/* JSON schemas */
|
|
||||||
"json.schemas": [
|
|
||||||
{
|
|
||||||
"fileMatch": [
|
|
||||||
"**/manifest.json"
|
|
||||||
],
|
|
||||||
"url": "https://schemas.elgato.com/streamdeck/plugins/manifest.json"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fileMatch": [
|
|
||||||
"**/layouts/*.json"
|
|
||||||
],
|
|
||||||
"url": "https://schemas.elgato.com/streamdeck/plugins/layout.json"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 224 KiB |
|
Before Width: | Height: | Size: 224 KiB |
|
Before Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 573 KiB |
|
Before Width: | Height: | Size: 573 KiB |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 575 KiB |
|
Before Width: | Height: | Size: 575 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 108 KiB |
@@ -1,80 +0,0 @@
|
|||||||
{
|
|
||||||
"Name": "iGoX BusyLight",
|
|
||||||
"Version": "0.3.1.0",
|
|
||||||
"Author": "iGoX",
|
|
||||||
"$schema": "https://schemas.elgato.com/streamdeck/plugins/manifest.json",
|
|
||||||
"Actions": [
|
|
||||||
{
|
|
||||||
"Name": "Set BusyLight status",
|
|
||||||
"UUID": "org.igox.busylight.status.set",
|
|
||||||
"Icon": "imgs/actions/icons/status/status",
|
|
||||||
"Tooltip": "Set BusyLight status",
|
|
||||||
"PropertyInspectorPath": "ui/status-config.html",
|
|
||||||
"Controllers": [
|
|
||||||
"Keypad"
|
|
||||||
],
|
|
||||||
"States": [
|
|
||||||
{
|
|
||||||
"Image": "imgs/actions/icons/status/status",
|
|
||||||
"TitleAlignment": "bottom"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "Set brightness",
|
|
||||||
"UUID": "org.igox.busylight.brigthness.set",
|
|
||||||
"Icon": "imgs/actions/icons/brightness/brightness",
|
|
||||||
"Tooltip": "Set LED brightness",
|
|
||||||
"PropertyInspectorPath": "ui/brightness-config.html",
|
|
||||||
"Controllers": [
|
|
||||||
"Keypad"
|
|
||||||
],
|
|
||||||
"States": [
|
|
||||||
{
|
|
||||||
"Image": "imgs/actions/icons/brightness/brightness",
|
|
||||||
"TitleAlignment": "bottom"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "Set color",
|
|
||||||
"UUID": "org.igox.busylight.color.set",
|
|
||||||
"Icon": "imgs/actions/icons/color/color",
|
|
||||||
"Tooltip": "Set BusyLight displayed color",
|
|
||||||
"PropertyInspectorPath": "ui/color-config.html",
|
|
||||||
"Controllers": [
|
|
||||||
"Keypad"
|
|
||||||
],
|
|
||||||
"States": [
|
|
||||||
{
|
|
||||||
"Image": "imgs/actions/icons/color/color",
|
|
||||||
"TitleAlignment": "bottom"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Category": "iGoX BusyLight",
|
|
||||||
"CategoryIcon": "imgs/plugin/category-icon",
|
|
||||||
"CodePath": "bin/plugin.js",
|
|
||||||
"Description": "Control your DIY BusyLight (https://github.com/igox/busylight) from your Stream Deck",
|
|
||||||
"Icon": "imgs/plugin/icon",
|
|
||||||
"SDKVersion": 2,
|
|
||||||
"Software": {
|
|
||||||
"MinimumVersion": "6.4"
|
|
||||||
},
|
|
||||||
"OS": [
|
|
||||||
{
|
|
||||||
"Platform": "mac",
|
|
||||||
"MinimumVersion": "10.15"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Platform": "windows",
|
|
||||||
"MinimumVersion": "10"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Nodejs": {
|
|
||||||
"Version": "20",
|
|
||||||
"Debug": "enabled"
|
|
||||||
},
|
|
||||||
"UUID": "org.igox.busylight"
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head lang="en">
|
|
||||||
<title>Configure your BusyLight</title>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<script src="https://sdpi-components.dev/releases/v3/sdpi-components.js"></script>
|
|
||||||
<script>
|
|
||||||
function getGlobalSettings() {
|
|
||||||
const { streamDeckClient } = SDPIComponents;
|
|
||||||
const settings = streamDeckClient.getGlobalSettings();
|
|
||||||
return settings.url || 'http://busylight-esp32.local';
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<!--
|
|
||||||
Learn more about property inspector components at https://sdpi-components.dev/docs/components
|
|
||||||
-->
|
|
||||||
<sdpi-item label="URL or IP">
|
|
||||||
<sdpi-textfield
|
|
||||||
setting="url"
|
|
||||||
placeholder="http://busylight-esp32.local"
|
|
||||||
global="true"
|
|
||||||
value="getGlobalSettings()">
|
|
||||||
</sdpi-textfield>
|
|
||||||
</sdpi-item>
|
|
||||||
<sdpi-item label="Brightness">
|
|
||||||
<sdpi-range
|
|
||||||
setting="brightness"
|
|
||||||
min="10"
|
|
||||||
max="100"
|
|
||||||
default="40"
|
|
||||||
value="40"
|
|
||||||
step="5"
|
|
||||||
showlabels="true">
|
|
||||||
<span slot="min">10%</span>
|
|
||||||
<span slot="max">100%</span>
|
|
||||||
</sdpi-range>
|
|
||||||
</sdpi-item>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head lang="en">
|
|
||||||
<title>Configure your BusyLight</title>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<script src="https://sdpi-components.dev/releases/v3/sdpi-components.js"></script>
|
|
||||||
<script>
|
|
||||||
function getGlobalSettings() {
|
|
||||||
const { streamDeckClient } = SDPIComponents;
|
|
||||||
const settings = streamDeckClient.getGlobalSettings();
|
|
||||||
return settings.url || 'http://busylight-esp32.local';
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<!--
|
|
||||||
Learn more about property inspector components at https://sdpi-components.dev/docs/components
|
|
||||||
-->
|
|
||||||
<sdpi-item label="URL or IP">
|
|
||||||
<sdpi-textfield
|
|
||||||
setting="url"
|
|
||||||
placeholder="http://busylight-esp32.local"
|
|
||||||
global="true"
|
|
||||||
value="getGlobalSettings()">
|
|
||||||
</sdpi-textfield>
|
|
||||||
</sdpi-item>
|
|
||||||
<sdpi-item label="Color">
|
|
||||||
<sdpi-color
|
|
||||||
setting="color"></sdpi-color>
|
|
||||||
</sdpi-item>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head lang="en">
|
|
||||||
<title>Configure your BusyLight</title>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<script src="https://sdpi-components.dev/releases/v3/sdpi-components.js"></script>
|
|
||||||
<script>
|
|
||||||
function getGlobalSettings() {
|
|
||||||
const { streamDeckClient } = SDPIComponents;
|
|
||||||
const settings = streamDeckClient.getGlobalSettings();
|
|
||||||
return settings.url || 'http://busylight-esp32.local';
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<!--
|
|
||||||
Learn more about property inspector components at https://sdpi-components.dev/docs/components
|
|
||||||
-->
|
|
||||||
<sdpi-item label="URL or IP">
|
|
||||||
<sdpi-textfield
|
|
||||||
setting="url"
|
|
||||||
placeholder="http://busylight-esp32.local"
|
|
||||||
global="true"
|
|
||||||
value="getGlobalSettings()">
|
|
||||||
</sdpi-textfield>
|
|
||||||
</sdpi-item>
|
|
||||||
<sdpi-item label="Status">
|
|
||||||
<sdpi-select setting="status" placeholder="Please choose a status">
|
|
||||||
<option value="available">Available</option>
|
|
||||||
<option value="away">Away</option>
|
|
||||||
<option value="busy">Busy</option>
|
|
||||||
<option value="on">On</option>
|
|
||||||
<option value="off">Off</option>
|
|
||||||
</sdpi-select>
|
|
||||||
</sdpi-item>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"scripts": {
|
|
||||||
"build": "rollup -c",
|
|
||||||
"watch": "rollup -c -w --watch.onEnd=\"streamdeck restart org.igox.busylight\""
|
|
||||||
},
|
|
||||||
"type": "module",
|
|
||||||
"devDependencies": {
|
|
||||||
"@elgato/cli": "^1.1.0",
|
|
||||||
"@rollup/plugin-commonjs": "^28.0.0",
|
|
||||||
"@rollup/plugin-node-resolve": "^15.2.2",
|
|
||||||
"@rollup/plugin-terser": "^0.4.4",
|
|
||||||
"@rollup/plugin-typescript": "^12.1.0",
|
|
||||||
"@tsconfig/node20": "^20.1.2",
|
|
||||||
"@types/node": "~20.15.0",
|
|
||||||
"rollup": "^4.0.2",
|
|
||||||
"tslib": "^2.6.2",
|
|
||||||
"typescript": "^5.2.2"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@elgato/streamdeck": "^1.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
import commonjs from "@rollup/plugin-commonjs";
|
|
||||||
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
||||||
import terser from "@rollup/plugin-terser";
|
|
||||||
import typescript from "@rollup/plugin-typescript";
|
|
||||||
import path from "node:path";
|
|
||||||
import url from "node:url";
|
|
||||||
|
|
||||||
const isWatching = !!process.env.ROLLUP_WATCH;
|
|
||||||
const sdPlugin = "org.igox.busylight.sdPlugin";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {import('rollup').RollupOptions}
|
|
||||||
*/
|
|
||||||
const config = {
|
|
||||||
input: "src/plugin.ts",
|
|
||||||
output: {
|
|
||||||
file: `${sdPlugin}/bin/plugin.js`,
|
|
||||||
sourcemap: isWatching,
|
|
||||||
sourcemapPathTransform: (relativeSourcePath, sourcemapPath) => {
|
|
||||||
return url.pathToFileURL(path.resolve(path.dirname(sourcemapPath), relativeSourcePath)).href;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
{
|
|
||||||
name: "watch-externals",
|
|
||||||
buildStart: function () {
|
|
||||||
this.addWatchFile(`${sdPlugin}/manifest.json`);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
typescript({
|
|
||||||
mapRoot: isWatching ? "./" : undefined
|
|
||||||
}),
|
|
||||||
nodeResolve({
|
|
||||||
browser: false,
|
|
||||||
exportConditions: ["node"],
|
|
||||||
preferBuiltins: true
|
|
||||||
}),
|
|
||||||
commonjs(),
|
|
||||||
!isWatching && terser(),
|
|
||||||
{
|
|
||||||
name: "emit-module-package-file",
|
|
||||||
generateBundle() {
|
|
||||||
this.emitFile({ fileName: "package.json", source: `{ "type": "module" }`, type: "asset" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
import streamDeck, { action, DidReceiveSettingsEvent, WillAppearEvent, KeyDownEvent, PropertyInspectorDidAppearEvent, SingletonAction } from "@elgato/streamdeck";
|
|
||||||
|
|
||||||
@action({ UUID: "org.igox.busylight.brigthness.set" })
|
|
||||||
export class SetBrightness extends SingletonAction<BrightnessSettings> {
|
|
||||||
|
|
||||||
override async onKeyDown(ev: KeyDownEvent<BrightnessSettings>): Promise<void> {
|
|
||||||
|
|
||||||
streamDeck.logger.debug(`>>> Received KeyDownEvent. Settings: ${JSON.stringify(ev.payload.settings)} <<<`);
|
|
||||||
|
|
||||||
const { settings } = ev.payload;
|
|
||||||
settings.brightness ??= 40;
|
|
||||||
setBrightness(settings.brightness);
|
|
||||||
}
|
|
||||||
|
|
||||||
override onWillAppear(ev: WillAppearEvent<BrightnessSettings>): void | Promise<void> {
|
|
||||||
|
|
||||||
streamDeck.logger.debug(`>>> Received WillAppearEvent. Settings: ${JSON.stringify(ev.payload.settings)} <<<`);
|
|
||||||
|
|
||||||
return ev.action.setTitle(`${ev.payload.settings.brightness ?? 40}%`);
|
|
||||||
}
|
|
||||||
|
|
||||||
override async onDidReceiveSettings(ev: DidReceiveSettingsEvent<BrightnessSettings>): Promise<void> {
|
|
||||||
|
|
||||||
streamDeck.logger.debug(`>>> Received onDidReceiveSettings. Settings: ${JSON.stringify(ev.payload.settings)} <<<`);
|
|
||||||
|
|
||||||
const { settings } = ev.payload;
|
|
||||||
await ev.action.setSettings(settings);
|
|
||||||
await ev.action.setTitle(`${settings.brightness}%`);
|
|
||||||
}
|
|
||||||
|
|
||||||
override async onPropertyInspectorDidAppear(ev: PropertyInspectorDidAppearEvent<BrightnessSettings>): Promise<void> {
|
|
||||||
streamDeck.logger.debug(`>>> Received onPropertyInspectorDidAppear. Setting action icon <<<`);
|
|
||||||
|
|
||||||
await ev.action.setImage(`imgs/actions/buttons/brigthness/brigthness.png`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function setBrightness(brightness: number) {
|
|
||||||
const settings = await streamDeck.settings.getGlobalSettings();
|
|
||||||
const url = settings.url;
|
|
||||||
|
|
||||||
streamDeck.logger.debug(`>>> Sending brightness: ${brightness} to ${url} <<<`);
|
|
||||||
|
|
||||||
fetch(`${url}/api/brightness`,
|
|
||||||
{
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
},
|
|
||||||
body: JSON.stringify({"brightness": brightness/100})
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => streamDeck.logger.debug(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
type BrightnessSettings = {
|
|
||||||
brightness?: number;
|
|
||||||
};
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
import streamDeck, { action, JsonObject, KeyDownEvent, DidReceiveSettingsEvent, PropertyInspectorDidAppearEvent, SingletonAction } from "@elgato/streamdeck";
|
|
||||||
|
|
||||||
@action({ UUID: "org.igox.busylight.color.set" })
|
|
||||||
export class SetColor extends SingletonAction {
|
|
||||||
override async onKeyDown(ev: KeyDownEvent<ColorSettings>): Promise<void> {
|
|
||||||
|
|
||||||
streamDeck.logger.debug(`>>> Received KeyDownEvent. Settings: ${JSON.stringify(ev.payload.settings)} <<<`);
|
|
||||||
|
|
||||||
const { settings } = ev.payload;
|
|
||||||
settings.color ??= '#FFFFFF';
|
|
||||||
setColor(hexToRgb(settings.color));
|
|
||||||
}
|
|
||||||
|
|
||||||
override async onDidReceiveSettings(ev: DidReceiveSettingsEvent<ColorSettings>): Promise<void> {
|
|
||||||
|
|
||||||
streamDeck.logger.debug(`>>> Received onDidReceiveSettings. Settings: ${JSON.stringify(ev.payload.settings)} <<<`);
|
|
||||||
|
|
||||||
const { settings } = ev.payload;
|
|
||||||
await ev.action.setSettings(settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
override async onPropertyInspectorDidAppear(ev: PropertyInspectorDidAppearEvent<ColorSettings>): Promise<void> {
|
|
||||||
streamDeck.logger.debug(`>>> Color button property inspector diplayed! <<<`);
|
|
||||||
|
|
||||||
await ev.action.setImage(`imgs/actions/buttons/colored/colored.png`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function hexToRgb(hex: string): { r: number, g: number, b: number } {
|
|
||||||
const hexNumber = parseInt(hex.replace('#', ''), 16);
|
|
||||||
const r = (hexNumber >> 16) & 255;
|
|
||||||
const g = (hexNumber >> 8) & 255;
|
|
||||||
const b = hexNumber & 255;
|
|
||||||
return { r, g, b };
|
|
||||||
}
|
|
||||||
|
|
||||||
async function setColor(color: JsonObject) {
|
|
||||||
const settings = await streamDeck.settings.getGlobalSettings();
|
|
||||||
const url = settings.url;
|
|
||||||
|
|
||||||
streamDeck.logger.debug(`>>> Sending color: ${JSON.stringify({"r": color.r, "g": color.g, "b": color.b})} to ${url} <<<`);
|
|
||||||
|
|
||||||
fetch(`${url}/api/color`,
|
|
||||||
{
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
},
|
|
||||||
body: JSON.stringify({"r": color.r, "g": color.g, "b": color.b})
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => streamDeck.logger.debug(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
type ColorSettings = {
|
|
||||||
color?: string;
|
|
||||||
};
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import streamDeck, { action, KeyDownEvent, SingletonAction, DidReceiveSettingsEvent } from "@elgato/streamdeck";
|
|
||||||
|
|
||||||
@action({ UUID: "org.igox.busylight.status.set" })
|
|
||||||
export class SetStatus extends SingletonAction {
|
|
||||||
override async onKeyDown(ev: KeyDownEvent<statusSettings>): Promise<void> {
|
|
||||||
const { settings } = ev.payload;
|
|
||||||
settings.status ??= 'available';
|
|
||||||
setStatus(settings.status);
|
|
||||||
}
|
|
||||||
|
|
||||||
override async onDidReceiveSettings(ev: DidReceiveSettingsEvent<statusSettings>): Promise<void> {
|
|
||||||
const { settings } = ev.payload;
|
|
||||||
let status = settings.status;
|
|
||||||
streamDeck.logger.debug(`>>> Config status changed to: ${status} <<<`);
|
|
||||||
|
|
||||||
await ev.action.setImage(`imgs/actions/buttons/${status}/${status}.png`);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function setStatus(status: string) {
|
|
||||||
const settings = await streamDeck.settings.getGlobalSettings();
|
|
||||||
const url = settings.url;
|
|
||||||
|
|
||||||
streamDeck.logger.debug(`>>> Sending status: ${status} to ${url} <<<`);
|
|
||||||
|
|
||||||
fetch(`${url}/api/status/${status}`,
|
|
||||||
{
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => streamDeck.logger.debug(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
type statusSettings = {
|
|
||||||
status?: string;
|
|
||||||
};
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import streamDeck, { LogLevel, SingletonAction, action, type DidReceiveSettingsEvent } from "@elgato/streamdeck";
|
|
||||||
|
|
||||||
import { SetStatus} from "./actions/set-status";
|
|
||||||
import { SetBrightness } from "./actions/set-brightness";
|
|
||||||
import { SetColor } from "./actions/set-color";
|
|
||||||
|
|
||||||
// We can enable "trace" logging so that all messages between the Stream Deck, and the plugin are recorded. When storing sensitive information
|
|
||||||
streamDeck.logger.setLevel(LogLevel.INFO);
|
|
||||||
|
|
||||||
// Register the actions.
|
|
||||||
streamDeck.actions.registerAction(new SetStatus());
|
|
||||||
streamDeck.actions.registerAction(new SetBrightness());
|
|
||||||
streamDeck.actions.registerAction(new SetColor());
|
|
||||||
|
|
||||||
// Finally, connect to the Stream Deck.
|
|
||||||
streamDeck.connect();
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "@tsconfig/node20/tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"customConditions": [
|
|
||||||
"node"
|
|
||||||
],
|
|
||||||
"module": "ES2022",
|
|
||||||
"moduleResolution": "Bundler",
|
|
||||||
"noImplicitOverride": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"src/**/*.ts"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 236 KiB |