check for onvif movement support before attempting movement (#13771)

This commit is contained in:
Josh Hawkins 2024-09-16 11:46:35 -05:00 committed by GitHub
parent e3edcf057c
commit 9bcb928715
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -335,6 +335,10 @@ class OnvifController:
) )
self._stop(camera_name) self._stop(camera_name)
if "pt" not in self.cams[camera_name]["features"]:
logger.error(f"{camera_name} does not support ONVIF pan/tilt movement.")
return
self.cams[camera_name]["active"] = True self.cams[camera_name]["active"] = True
onvif: ONVIFCamera = self.cams[camera_name]["onvif"] onvif: ONVIFCamera = self.cams[camera_name]["onvif"]
move_request = self.cams[camera_name]["move_request"] move_request = self.cams[camera_name]["move_request"]
@ -476,6 +480,10 @@ class OnvifController:
) )
self._stop(camera_name) self._stop(camera_name)
if "zoom" not in self.cams[camera_name]["features"]:
logger.error(f"{camera_name} does not support ONVIF zooming.")
return
self.cams[camera_name]["active"] = True self.cams[camera_name]["active"] = True
onvif: ONVIFCamera = self.cams[camera_name]["onvif"] onvif: ONVIFCamera = self.cams[camera_name]["onvif"]
move_request = self.cams[camera_name]["move_request"] move_request = self.cams[camera_name]["move_request"]