mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-05 14:47:40 +03:00
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:
parent
6d0a681dc0
commit
4dfc248df4
@ -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": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user