mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-07 12:31:15 +03:00
mypy
This commit is contained in:
parent
3985cb595f
commit
d95340d509
@ -412,8 +412,6 @@ class Dispatcher:
|
|||||||
for camera_name, features in state.items():
|
for camera_name, features in state.items():
|
||||||
if camera_name not in self.config.cameras:
|
if camera_name not in self.config.cameras:
|
||||||
continue
|
continue
|
||||||
if not isinstance(features, dict):
|
|
||||||
continue
|
|
||||||
for topic, value in features.items():
|
for topic, value in features.items():
|
||||||
handler = self._camera_settings_handlers.get(topic)
|
handler = self._camera_settings_handlers.get(topic)
|
||||||
if handler is None:
|
if handler is None:
|
||||||
|
|||||||
@ -48,7 +48,14 @@ class RuntimeStatePersistence:
|
|||||||
logger.error("Timed out acquiring runtime state lock for load")
|
logger.error("Timed out acquiring runtime state lock for load")
|
||||||
return {}
|
return {}
|
||||||
cameras = data.get("cameras", {})
|
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:
|
def set(self, camera: str, topic: str, value: bool) -> None:
|
||||||
"""Persist a single (camera, topic, value). No-op if topic untracked."""
|
"""Persist a single (camera, topic, value). No-op if topic untracked."""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user