Merge pull request #66 from ibs0d/claude/fix-zoom-statistics-WFvOm

fix: sync {camera}/motion topic from camera_activity updates
This commit is contained in:
ibs0d 2026-03-18 17:51:56 +11:00 committed by GitHub
commit 44feb916c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -149,6 +149,12 @@ function applyCameraActivity(payload: string) {
for (const [name, state] of Object.entries(activity)) { for (const [name, state] of Object.entries(activity)) {
applyTopicUpdate(`camera_activity/${name}`, state); applyTopicUpdate(`camera_activity/${name}`, state);
// Sync motion state so {camera}/motion topic stays up-to-date with
// camera_activity and doesn't remain stale from a retained MQTT value.
if (state.motion !== undefined) {
applyTopicUpdate(`${name}/motion`, state.motion ? "ON" : "OFF");
}
const cameraConfig = state?.config; const cameraConfig = state?.config;
if (!cameraConfig) continue; if (!cameraConfig) continue;