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
This commit is contained in:
Nicolas Mowen 2023-09-01 06:07:18 -06:00 committed by GitHub
parent bd0d16a75b
commit 2e4f5bc0e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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