From b4cea2f287d6c46cebfebbacfd82d76d791872b2 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 9 Jun 2026 22:57:45 +0000 Subject: [PATCH] feat: include measurement_start_time in cached /status response So consumers (e.g. the command center) can read the elapsed-time clock from the cached status instead of a fresh device /live read. Added to both the GET and POST /status data dicts. Co-Authored-By: Claude Opus 4.8 (1M context) --- app/routers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/routers.py b/app/routers.py index aae9a23..be83f41 100644 --- a/app/routers.py +++ b/app/routers.py @@ -785,6 +785,7 @@ def get_status(unit_id: str, db: Session = Depends(get_db)): "unit_id": unit_id, "last_seen": status.last_seen.isoformat() if status.last_seen else None, "measurement_state": status.measurement_state, + "measurement_start_time": status.measurement_start_time.isoformat() if status.measurement_start_time else None, "lp": status.lp, "leq": status.leq, "lmax": status.lmax, @@ -843,6 +844,7 @@ def upsert_status(unit_id: str, payload: StatusPayload, db: Session = Depends(ge "unit_id": unit_id, "last_seen": status.last_seen.isoformat(), "measurement_state": status.measurement_state, + "measurement_start_time": status.measurement_start_time.isoformat() if status.measurement_start_time else None, "lp": status.lp, "leq": status.leq, "lmax": status.lmax,