feat: add CRUD endpoints for sensors, actors, and sensor readings; update README and integration tests

This commit is contained in:
2026-01-10 14:28:57 +01:00
parent 81677943c4
commit 52c72b13bb
6 changed files with 653 additions and 1 deletions
+3 -1
View File
@@ -62,7 +62,9 @@ The compose file seeds the database from `ai-improved.sql` and exposes:
- `POST /login` — demo login, body `{ "username": "admin", "password": "password" }`, returns `{ "token": "..." }`
- `GET /protected` — JWT required
- `GET /devices` — list devices (public) / `POST /devices`, `GET/PUT/DELETE /devices/:id` (JWT)
- `POST /sensors` — create sensor (JWT)
- Sensors (JWT): `GET /sensors`, `GET /sensors/:id`, `POST /sensors`, `PUT /sensors/:id`, `DELETE /sensors/:id`
- Actors (JWT): `GET /actors`, `GET /actors/:id`, `POST /actors`, `PUT /actors/:id`, `DELETE /actors/:id`
- Sensor readings (JWT): `GET /sensor-readings`, `GET /sensor-readings/:id`, `POST /sensor-readings`, `PUT /sensor-readings/:id`, `DELETE /sensor-readings/:id` (optional `sensor_id` filter and pagination via `limit`, `page`)
- `GET /mqttping` — publish timestamp to MQTT default topic (JWT)
- `GET /messages` — last stored MQTT state messages from SQLite (JWT)