Switch Endpoints
GET /api/switch
Returns the current switch state.
Response:
| State |
Description |
0 |
RF0 |
1 |
RF1 |
POST /api/switch
Sets the switch state.
Request:
Response:
Errors:
400 — Invalid state value (must be 0 or 1)
500 — Failed to set switch state
Example:
# Set switch to RF1
curl -X POST -H "Content-Type: application/json" \
-d '{"state": 1}' \
http://<device-ip>/api/switch
# Set switch to RF0
curl -X POST -H "Content-Type: application/json" \
-d '{"state": 0}' \
http://<device-ip>/api/switch
# Query current state
curl http://<device-ip>/api/switch