This commit is contained in:
Josh Hawkins 2026-05-27 12:50:54 -05:00
parent 3985cb595f
commit d95340d509
2 changed files with 8 additions and 3 deletions

View File

@ -412,8 +412,6 @@ class Dispatcher:
for camera_name, features in state.items():
if camera_name not in self.config.cameras:
continue
if not isinstance(features, dict):
continue
for topic, value in features.items():
handler = self._camera_settings_handlers.get(topic)
if handler is None:

View File

@ -48,7 +48,14 @@ class RuntimeStatePersistence:
logger.error("Timed out acquiring runtime state lock for load")
return {}
cameras = data.get("cameras", {})
return cameras if isinstance(cameras, dict) else {}
if not isinstance(cameras, dict):
return {}
# Filter out malformed camera entries so callers can trust the shape.
return {
name: features
for name, features in cameras.items()
if isinstance(features, dict)
}
def set(self, camera: str, topic: str, value: bool) -> None:
"""Persist a single (camera, topic, value). No-op if topic untracked."""