Add expected time to device status bar
Build and push server image / test (push) Successful in 39s
Build and push server image / build-and-push (push) Successful in 2m38s
Build and push server image / deploy (push) Successful in 58s

This commit is contained in:
2026-07-28 01:37:33 +00:00
parent aa4a382c1b
commit 575b3cfa61
2 changed files with 16 additions and 0 deletions
+8
View File
@@ -244,6 +244,14 @@ def api_status(
"device": {
"last_seen": frame.last_seen or None,
"overdue": bool(frame.last_seen and now - frame.last_seen > overdue_gap),
# When the device is next expected to check in, per the same
# sleep duration frame_config() actually hands it (see
# device.py's /frame/config) -- not the raw overdue_gap above,
# which is deliberately generous (OVERDUE_FACTOR) to avoid
# false alarms during quiet hours rather than a best guess.
"expected_next_checkin": (
frame.last_seen + quiet_hours.effective_refresh_interval_s(frame) if frame.last_seen else None
),
"firmware_version": frame.device_firmware_version or None,
"firmware_available": frame.firmware_available_version or None,
"battery": (
+8
View File
@@ -18,6 +18,14 @@ function renderDeviceStatusBar(device) {
}
const now = Date.now() / 1000;
const rows = [];
if (device.expected_next_checkin) {
const remaining = device.expected_next_checkin - now;
rows.push([
'Expected in',
remaining > 0 ? `~${formatDuration(remaining)}` : 'Any moment',
device.overdue,
]);
}
const ago = formatDuration(Math.max(0, now - device.last_seen));
rows.push(['Last seen', `${ago} ago`, device.overdue]);
if (device.firmware_version) {