# README
PicoW LED Server
Notes
Endpoints:
Endpoint | GET | POST | PUT | DELETE |
---|---|---|---|---|
/ | x | |||
/ws | x |
WebSocket Events:
Type | Data |
---|---|
error | string |
devices | WSEvents_Device[] |
device | WSEvents_Device |
WebSocket Commands:
Command | Data |
---|---|
GET api.devices | null |
POST api.device | WSEvents_Device |
PUT api.device | WSEvents_Device |
DELETE api.device | { addr: string } |
POST api.device.pins | { addr: string; pins: number[] } |
POST api.device.color | { addr: string; color: number[] } |
TS Types:
frontend/src/lib/websocket/types.ts
export interface WSEvents_Device {
server: WSEvents_DeviceServer;
pins?: number[];
color?: number[];
}
export interface WSEvents_DeviceServer {
name?: string;
addr: string;
online?: boolean;
}