Skip to content

Commit

Permalink
Don't fail ptz if camera does not support relative zoom (#7542)
Browse files Browse the repository at this point in the history
* Remove relative zoom space as it is not used

* Catch case where camera does not support relative zoom

* Cleanup
  • Loading branch information
NickM-27 authored Sep 1, 2023
1 parent bd0d16a commit 2e4f5bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frigate/ptz/onvif.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,15 @@ def _init_onvif(self, camera_name: str) -> bool:
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
Expand Down

0 comments on commit 2e4f5bc

Please sign in to comment.