From 4dfc248df4d5b124b3981223e0bc95dfb352edad Mon Sep 17 00:00:00 2001 From: Ryan Gregg Date: Sun, 15 Mar 2026 00:38:00 +0000 Subject: [PATCH] Handle missing zoom translation gracefully in RelativeMove When a camera reports zoom-r support but the zeep move request object lacks a Zoom translation attribute, fall back to sending pan/tilt only instead of crashing silently. This allows the ONVIF proxy to handle zoom separately via digital zoom. Co-Authored-By: Claude Opus 4.6 (1M context) --- frigate/ptz/onvif.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/frigate/ptz/onvif.py b/frigate/ptz/onvif.py index be3a83bb7..d22bb04a3 100644 --- a/frigate/ptz/onvif.py +++ b/frigate/ptz/onvif.py @@ -542,14 +542,25 @@ class OnvifController: == ZoomingModeEnum.relative ) ): - move_request.Speed = { - "PanTilt": { - "x": speed, - "y": speed, - }, - "Zoom": {"x": speed}, - } - move_request.Translation.Zoom.x = zoom + try: + move_request.Speed = { + "PanTilt": { + "x": speed, + "y": speed, + }, + "Zoom": {"x": speed}, + } + move_request.Translation.Zoom.x = zoom + except (AttributeError, KeyError): + logger.warning( + f"{camera_name}: zoom translation not available, sending pan/tilt only" + ) + move_request.Speed = { + "PanTilt": { + "x": speed, + "y": speed, + }, + } else: move_request.Speed = { "PanTilt": {