From 2e4f5bc0e024bbfac21b8533694573ba7c81aae6 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 1 Sep 2023 06:07:18 -0600 Subject: [PATCH] Don't fail ptz if camera does not support relative zoom (#7542) * Remove relative zoom space as it is not used * Catch case where camera does not support relative zoom * Cleanup --- frigate/ptz/onvif.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frigate/ptz/onvif.py b/frigate/ptz/onvif.py index 63a195651..5c2780fcc 100644 --- a/frigate/ptz/onvif.py +++ b/frigate/ptz/onvif.py @@ -104,9 +104,15 @@ class OnvifController: move_request.Translation.PanTilt.space = ptz_config["Spaces"][ "RelativePanTiltTranslationSpace" ][fov_space_id]["URI"] + + try: move_request.Translation.Zoom.space = ptz_config["Spaces"][ "RelativeZoomTranslationSpace" ][0]["URI"] + except Exception: + # camera does not support relative zoom + pass + if move_request.Speed is None: move_request.Speed = ptz.GetStatus({"ProfileToken": profile.token}).Position self.cams[camera_name]["relative_move_request"] = move_request