From 2a121d32671862e92cd9b4022b9ea0b8a0fdd2d6 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 15 Oct 2023 14:14:47 -0500 Subject: [PATCH] negate zoom out condition when needed --- frigate/ptz/autotrack.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frigate/ptz/autotrack.py b/frigate/ptz/autotrack.py index 673c47bf9..e64768bec 100644 --- a/frigate/ptz/autotrack.py +++ b/frigate/ptz/autotrack.py @@ -844,9 +844,10 @@ class PtzAutoTracker: ) - 1 ) + logger.debug(f"{camera}: Zoom calculation: {zoom}") if not result: # zoom out - zoom = -(1 - zoom) if zoom != 0 else 0 + zoom = -(1 - abs(zoom)) if zoom > 0 else zoom logger.debug(f"{camera}: Zooming: {result} Zoom amount: {zoom}")