disable zooming if relative zoom not supported

This commit is contained in:
Josh Hawkins 2023-10-02 10:09:01 -05:00
parent 9a4f970337
commit 07b5dcc40a

View File

@ -131,18 +131,24 @@ class OnvifController:
# try setting relative zoom translation space # try setting relative zoom translation space
try: 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: if zoom_space_id is not None:
move_request.Translation.Zoom.space = ptz_config["Spaces"][ move_request.Translation.Zoom.space = ptz_config["Spaces"][
"RelativeZoomTranslationSpace" "RelativeZoomTranslationSpace"
][0]["URI"] ][0]["URI"]
except Exception: 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[ self.config.cameras[
camera_name camera_name
].onvif.autotracking.zoom_relative = False ].onvif.autotracking.zooming = ZoomingModeEnum.disabled
logger.warning( 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: if move_request.Speed is None: