fix: add reboot endpoint and test documentation

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-03 11:01:04 -04:00
parent 4e46411e1c
commit 93a83789f0
2 changed files with 51 additions and 0 deletions

View File

@@ -135,6 +135,13 @@ void AppWebServer::setupAPIRoutes() {
delay(100);
_power->enterDeepSleep();
});
_server.on("/api/action/reboot", HTTP_POST,
[](AsyncWebServerRequest* req) {
req->send(200, "application/json", "{\"ok\":true,\"msg\":\"Rebooting...\"}");
delay(500);
ESP.restart();
});
}
void AppWebServer::setupStaticFiles() {

44
test/README.md Normal file
View File

@@ -0,0 +1,44 @@
# Testing
## Native Tests (host machine)
Run algorithm tests that don't require hardware:
```bash
pio test -e native
```
Tests:
- `test_photo_queue.cpp` — queue cycling, favorites weighting
- `test_image_pipeline.cpp` — nearest color, dithering correctness
## On-Device Testing
Flash and monitor:
```bash
pio run -e m5stack-papercolor -t upload && pio device monitor
```
### Verification Checklist
- [ ] Device boots and prints version to serial
- [ ] AP mode activates on first boot
- [ ] Captive portal serves setup page at 192.168.4.1
- [ ] WiFi credentials save and device reboots to station mode
- [ ] mDNS resolves at papercolor.local
- [ ] Web UI dashboard shows battery/WiFi/uptime
- [ ] Albums page lists Immich albums
- [ ] Album selection persists across reboots
- [ ] Photos download and display correctly
- [ ] Portrait photos pair side-by-side
- [ ] Slideshow advances at configured interval
- [ ] BTN_UP: next photo (LED flashes white)
- [ ] BTN_TOP: random photo (LED flashes white)
- [ ] BTN_DOWN: pause/play toggle
- [ ] BTN_TOP+BTN_DOWN 3s: deep sleep
- [ ] BTN_UP 5s: factory reset
- [ ] Battery LED: orange at 25%, red at 10%
- [ ] OTA upload succeeds via web UI
- [ ] Device recovers from WiFi disconnect (reconnect on next cycle)