chore(devices): TEMP log power-monitor telemetry headers from firmware
CI / test (push) Has been cancelled

Firmware emits X-Prev-Awake-Ms + X-Prev-Panel-Init-Ms on each poll
so we can verify the 13.3" PIN_PWR rail-cut change isn't slowing
the panel re-init or extending the awake window. Log them with
boot-reason context via `device.poll.power_telemetry` — greppable
in `docker logs pictureframe-php-1`. Remove this log + the
firmware NVS_KEY_PREV_* writes once the change is validated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 14:15:50 -04:00
parent 76c72f69d8
commit 8ae4a2fd5a
+16
View File
@@ -90,6 +90,22 @@ class DeviceImageController extends AbstractController
$currentImageId = (int) $request->headers->get('X-Current-Image-Id', '-1'); $currentImageId = (int) $request->headers->get('X-Current-Image-Id', '-1');
$device->markSeen(); $device->markSeen();
// TEMP: power-monitor — surface the firmware's previous-cycle
// telemetry (awake duration + panel-init time) so we can see
// whether the PIN_PWR rail cut affects either. Logged on every
// poll; greppable via `device.poll.power_telemetry`. Remove
// alongside the firmware's NVS_KEY_PREV_* writes once validated.
$prevAwakeMs = $request->headers->get('X-Prev-Awake-Ms');
$prevPanelInitMs = $request->headers->get('X-Prev-Panel-Init-Ms');
if ($prevAwakeMs !== null || $prevPanelInitMs !== null) {
$this->logger->info('device.poll.power_telemetry', [
'mac' => $mac,
'prev_awake_ms' => $prevAwakeMs,
'prev_panel_init_ms' => $prevPanelInitMs,
'boot_reason' => $request->headers->get('X-Boot-Reason'),
]);
}
// Auto-correct Device.model from the firmware's X-Panel-Id header. New // Auto-correct Device.model from the firmware's X-Panel-Id header. New
// Devices are created with the default V1 model (see Device entity), so // Devices are created with the default V1 model (see Device entity), so
// a freshly-claimed 13.3" unit ends up wrongly flagged until its first // a freshly-claimed 13.3" unit ends up wrongly flagged until its first