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) <noreply@anthropic.com>
This commit is contained in:
Ryan Gregg
2026-03-18 02:11:59 +00:00
co-authored by Claude Opus 4.6
parent 6d0a681dc0
commit 4dfc248df4
+11
View File
@@ -542,6 +542,7 @@ class OnvifController:
== ZoomingModeEnum.relative
)
):
try:
move_request.Speed = {
"PanTilt": {
"x": speed,
@@ -550,6 +551,16 @@ class OnvifController:
"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": {