mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-18 00:54:27 +03:00
Catch onvif command error
This commit is contained in:
parent
b149828c9f
commit
7bf2b56ce6
@ -558,6 +558,7 @@ class OnvifController:
|
|||||||
if not self._init_onvif(camera_name):
|
if not self._init_onvif(camera_name):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
if command == OnvifCommandEnum.init:
|
if command == OnvifCommandEnum.init:
|
||||||
# already init
|
# already init
|
||||||
return
|
return
|
||||||
@ -569,11 +570,14 @@ class OnvifController:
|
|||||||
_, pan, tilt = param.split("_")
|
_, pan, tilt = param.split("_")
|
||||||
self._move_relative(camera_name, float(pan), float(tilt), 0, 1)
|
self._move_relative(camera_name, float(pan), float(tilt), 0, 1)
|
||||||
elif (
|
elif (
|
||||||
command == OnvifCommandEnum.zoom_in or command == OnvifCommandEnum.zoom_out
|
command == OnvifCommandEnum.zoom_in
|
||||||
|
or command == OnvifCommandEnum.zoom_out
|
||||||
):
|
):
|
||||||
self._zoom(camera_name, command)
|
self._zoom(camera_name, command)
|
||||||
else:
|
else:
|
||||||
self._move(camera_name, command)
|
self._move(camera_name, command)
|
||||||
|
except ONVIFError as e:
|
||||||
|
logger.error(f"Unable to handle onvif command: {e}")
|
||||||
|
|
||||||
def get_camera_info(self, camera_name: str) -> dict[str, any]:
|
def get_camera_info(self, camera_name: str) -> dict[str, any]:
|
||||||
if camera_name not in self.cams.keys():
|
if camera_name not in self.cams.keys():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user