feat(devices): Open Pixel Control (OPC) target type
Adds support for Open Pixel Control receivers (Fadecandy boards, xLights/Falcon endpoints, OPC bridges, art-installation controllers, hobbyist LED driver software). OPC is a tiny TCP protocol on port 7890 with a 4-byte header [channel][cmd][len_hi][len_lo] + RGB body. Backend: - OPCClient opens one persistent TCP connection and streams frames as header+body byte pairs. Channel 0 broadcasts to every output on the OPC server; channels 1-255 address a specific channel on multi-output servers (Fadecandy with multiple Open Pixel chains). - supports_fast_send=True with a synchronous send_pixels_fast hot path. The fast path skips the async drain so the OS write-buffer flushes on its own schedule -- exactly what ambilight streaming wants. - Brightness applies client-side before the frame is sent (OPC has no reply channel for hardware-side brightness). - Health check opens a TCP connection and closes it. - OPCConfig joins the typed config union; storage gains an opc_channel field; full to_dict/from_dict/to_config wiring. - 36 unit tests cover URL parsing, header construction, send_pixels emitting header+body in order, brightness application, list and flat-array input shapes, drain behavior, connection lifecycle, provider validate/discover/capabilities, Device.to_config round-trip. Frontend: - 'opc' in DEVICE_TYPE_KEYS (next to 'ddp'), paper-plane icon -- same as DDP since both are open pixel-streaming protocols. - isOpcDevice predicate + per-type field show/hide. - Optional channel number input (default 0 = broadcast) with hint copy explaining the channel semantics. - Locale strings in en/ru/zh. No native discovery (OPC has no discovery protocol); users supply the receiver IP manually.
This commit is contained in:
@@ -738,7 +738,10 @@ After phase 1 the codebase will have 3 fresh examples of "ping the LAN, listen f
|
||||
|
||||
### Phase 5 — Open pixel protocols (cheap completionism)
|
||||
|
||||
- [ ] OPC (Open Pixel Control)
|
||||
- [x] **OPC (Open Pixel Control)** — TCP, port 7890, 4-byte header
|
||||
`[channel][cmd][len_hi][len_lo]` + RGB body. Channel 0 broadcasts.
|
||||
Single-pixel-strip protocol, no discovery, no pairing. 36 unit
|
||||
tests. Fadecandy + xLights + hobbyist receivers reachable.
|
||||
- [ ] TPM2.net
|
||||
|
||||
### Phase 6 — PC gaming RGB completion
|
||||
|
||||
Reference in New Issue
Block a user