diff --git a/API.md b/API.md index a0702b8..8828ac7 100644 --- a/API.md +++ b/API.md @@ -7,87 +7,87 @@ All API endpoints return JSON unless otherwise noted. ## Static Files -| Route | Method | Description | Response Type | -|------------------|--------|------------------------------|--------------| -| `/` | GET | Main page | HTML | -| `/settings` | GET | Settings page | HTML | -| `/rfid` | GET | RFID page | HTML | -| `/firmware.bin` | GET | Firmware file (SPIFFS) | Binary | +| Route | Method | Description | Response Type | +| --------------- | ------ | ---------------------- | ------------- | +| `/` | GET | Main page | HTML | +| `/settings` | GET | Settings page | HTML | +| `/rfid` | GET | RFID page | HTML | +| `/firmware.bin` | GET | Firmware file (SPIFFS) | Binary | --- ## Timer & Data -| Route | Method | Description | Request Body/Params | Response Example | -|-------------------|--------|-------------------------------------|--------------------|------------------| -| `/api/data` | GET | Get current timer and status data | – | `{...}` | -| `/api/reset-best` | POST | Reset best times | – | `{ "success": true }` | +| Route | Method | Description | Request Body/Params | Response Example | +| ----------------- | ------ | --------------------------------- | ------------------- | --------------------- | +| `/api/data` | GET | Get current timer and status data | – | `{...}` | +| `/api/reset-best` | POST | Reset best times | – | `{ "success": true }` | --- ## Button Learning -| Route | Method | Description | Request Body/Params | Response Example | -|------------------------|--------|-------------------------------------|--------------------|------------------| -| `/api/unlearn-button` | POST | Remove all button assignments | – | `{ "success": true }` | -| `/api/start-learning` | POST | Start button learning mode | – | `{ "success": true }` | -| `/api/stop-learning` | POST | Stop button learning mode | – | `{ "success": true }` | -| `/api/learn/status` | GET | Get learning mode status | – | `{ "active": true, "step": 1 }` | -| `/api/buttons/status` | GET | Get button assignment and voltage | – | `{ "lane1Start": true, "lane1StartVoltage": 3.3, ... }` | +| Route | Method | Description | Request Body/Params | Response Example | +| --------------------- | ------ | --------------------------------- | ------------------- | ------------------------------------------------------- | +| `/api/unlearn-button` | POST | Remove all button assignments | – | `{ "success": true }` | +| `/api/start-learning` | POST | Start button learning mode | – | `{ "success": true }` | +| `/api/stop-learning` | POST | Stop button learning mode | – | `{ "success": true }` | +| `/api/learn/status` | GET | Get learning mode status | – | `{ "active": true, "step": 1 }` | +| `/api/buttons/status` | GET | Get button assignment and voltage | – | `{ "lane1Start": true, "lane1StartVoltage": 3.3, ... }` | --- ## Settings -| Route | Method | Description | Request Body/Params | Response Example | -|----------------------|--------|-------------------------------------|--------------------|------------------| -| `/api/set-max-time` | POST | Set max timer and display time | `maxTime`, `maxTimeDisplay` (form params, seconds) | `{ "success": true }` | -| `/api/get-settings` | GET | Get current timer settings | – | `{ "maxTime": 300, "maxTimeDisplay": 20 }` | +| Route | Method | Description | Request Body/Params | Response Example | +| ------------------- | ------ | ------------------------------ | --------------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `/api/set-max-time` | POST | Set max timer and display time | `maxTime`, `maxTimeDisplay`, `minTimeForLeaderboard` (form params, seconds) | `{ "success": true }` | +| `/api/get-settings` | GET | Get current timer settings | – | `{ "maxTime": 300, "maxTimeDisplay": 20, "minTimeForLeaderboard": 5 }` | --- ## WiFi Configuration -| Route | Method | Description | Request Body/Params | Response Example | -|-------------------|--------|-------------------------------------|--------------------|------------------| -| `/api/set-wifi` | POST | Set WiFi SSID and password | `ssid`, `password` (form params) | `{ "success": true }` | -| `/api/get-wifi` | GET | Get current WiFi SSID and password | – | `{ "ssid": "...", "password": "..." }` | +| Route | Method | Description | Request Body/Params | Response Example | +| --------------- | ------ | ---------------------------------- | -------------------------------- | -------------------------------------- | +| `/api/set-wifi` | POST | Set WiFi SSID and password | `ssid`, `password` (form params) | `{ "success": true }` | +| `/api/get-wifi` | GET | Get current WiFi SSID and password | – | `{ "ssid": "...", "password": "..." }` | --- ## Location Configuration -| Route | Method | Description | Request Body/Params | Response Example | -|----------------------|--------|-------------------------------------|--------------------|------------------| -| `/api/set-location` | POST | Set location name and ID | `id`, `name` (form params) | `{ "success": true }` | -| `/api/get-location` | GET | Get current location | – | `{ "locationid": "..." }` | +| Route | Method | Description | Request Body/Params | Response Example | +| ------------------- | ------ | ------------------------ | -------------------------- | ------------------------- | +| `/api/set-location` | POST | Set location name and ID | `id`, `name` (form params) | `{ "success": true }` | +| `/api/get-location` | GET | Get current location | – | `{ "locationid": "..." }` | --- ## Button Update & Mode -| Route | Method | Description | Request Body/Params | Response Example | -|----------------------|--------|-------------------------------------|--------------------|------------------| -| `/api/updateButtons` | GET | Trigger MQTT update for buttons | – | `{ "success": true }` | -| `/api/set-mode` | POST | Set operational mode | `mode` (form param: "individual" or "wettkampf") | `{ "success": true }` | -| `/api/get-mode` | GET | Get current operational mode | – | `{ "mode": "individual" }` | +| Route | Method | Description | Request Body/Params | Response Example | +| -------------------- | ------ | ------------------------------- | ------------------------------------------------ | -------------------------- | +| `/api/updateButtons` | GET | Trigger MQTT update for buttons | – | `{ "success": true }` | +| `/api/set-mode` | POST | Set operational mode | `mode` (form param: "individual" or "wettkampf") | `{ "success": true }` | +| `/api/get-mode` | GET | Get current operational mode | – | `{ "mode": "individual" }` | --- ## System Info -| Route | Method | Description | Request Body/Params | Response Example | -|---------------|--------|-------------------------------------|--------------------|------------------| -| `/api/info` | GET | Get system info (IP, MAC, memory, license, etc.) | – | `{ "ip": "...", "ipSTA": "...", "channel": 1, "mac": "...", "freeMemory": 123456, "connectedButtons": 3, "isOnline": true, "valid": "Ja", "tier": 1 }` | +| Route | Method | Description | Request Body/Params | Response Example | +| ----------- | ------ | ------------------------------------------------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `/api/info` | GET | Get system info (IP, MAC, memory, license, etc.) | – | `{ "ip": "...", "ipSTA": "...", "channel": 1, "mac": "...", "freeMemory": 123456, "connectedButtons": 3, "isOnline": true, "valid": "Ja", "tier": 1 }` | --- ## WebSocket -| Route | Description | -|---------|------------------------------------| -| `/ws` | WebSocket endpoint for live updates| +| Route | Description | +| ----- | ----------------------------------- | +| `/ws` | WebSocket endpoint for live updates | --- -**All API endpoints return JSON unless otherwise noted. POST requests expect form parameters (not JSON body).** \ No newline at end of file +**All API endpoints return JSON unless otherwise noted. POST requests expect form parameters (not JSON body).** diff --git a/apientpoints b/apientpoints index 9e32638..2d01232 100644 --- a/apientpoints +++ b/apientpoints @@ -9,7 +9,7 @@ POST /api/unlearn-button → Verlernt alle Button-Zuordnungen POST /api/set-max-time -→ Setzt die maximale Zeit und maxTimeDisplay +→ Setzt die maximale Zeit, maxTimeDisplay und minTimeForLeaderboard GET /api/get-settings → Gibt die aktuellen Einstellungen zurück diff --git a/data/firmware.bin b/data/firmware.bin deleted file mode 100644 index 624ab84..0000000 Binary files a/data/firmware.bin and /dev/null differ diff --git a/data/settings.html b/data/settings.html index ee9dc6c..50382fe 100644 --- a/data/settings.html +++ b/data/settings.html @@ -182,6 +182,18 @@ title="Zeit nach der die angezeigte Zeit zurückgesetzt wird" /> +
+ + +