From 20c2ab39bc866df907e0134d77cf40b7769cb000 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sat, 7 Oct 2023 09:17:54 -0500 Subject: [PATCH] disable zooming if relative zoom not supported (#8028) --- frigate/ptz/onvif.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/frigate/ptz/onvif.py b/frigate/ptz/onvif.py index b8794b6f1..32e55b748 100644 --- a/frigate/ptz/onvif.py +++ b/frigate/ptz/onvif.py @@ -131,18 +131,24 @@ class OnvifController: # try setting relative zoom translation space try: - if self.config.cameras[camera_name].onvif.autotracking.zooming: + if ( + self.config.cameras[camera_name].onvif.autotracking.zooming + == ZoomingModeEnum.relative + ): if zoom_space_id is not None: move_request.Translation.Zoom.space = ptz_config["Spaces"][ "RelativeZoomTranslationSpace" ][0]["URI"] except Exception: - if self.config.cameras[camera_name].onvif.autotracking.zoom_relative: + if ( + self.config.cameras[camera_name].onvif.autotracking.zooming + == ZoomingModeEnum.relative + ): self.config.cameras[ camera_name - ].onvif.autotracking.zoom_relative = False + ].onvif.autotracking.zooming = ZoomingModeEnum.disabled logger.warning( - f"Disabling autotracking zooming for {camera_name}: Absolute zoom not supported" + f"Disabling autotracking zooming for {camera_name}: Relative zoom not supported" ) if move_request.Speed is None: