From 91e6c7ae9105c7e53766aa0d34d7cb0b7478f970 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 27 Apr 2025 14:06:43 -0500 Subject: [PATCH] config migrator --- frigate/util/config.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frigate/util/config.py b/frigate/util/config.py index 7bdc0c3d6b..0bfafe5c55 100644 --- a/frigate/util/config.py +++ b/frigate/util/config.py @@ -319,6 +319,21 @@ def migrate_016_0(config: dict[str, dict[str, any]]) -> dict[str, dict[str, any] camera_config["live"] = live_config + # add another value to movement_weights for autotracking cams + onvif_config = camera_config.get("onvif", {}) + if "autotracking" in onvif_config: + movement_weights = ( + camera_config.get("onvif", {}) + .get("autotracking") + .get("movement_weights", {}) + ) + + if movement_weights and len(movement_weights.split(",")) == 5: + onvif_config["autotracking"]["movement_weights"] = ( + movement_weights + ", 1" + ) + camera_config["onvif"] = onvif_config + new_config["cameras"][name] = camera_config new_config["version"] = "0.16-0"