@@ -16,6 +16,31 @@ def _stop_zooming_or_focusing(self) -> Dict:
16
16
data = [{"cmd" : "PtzCtrl" , "action" : 0 , "param" : {"channel" : 0 , "op" : "Stop" }}]
17
17
return self ._execute_command ('PtzCtrl' , data )
18
18
19
+ def get_zoom_focus (self ) -> Dict :
20
+ """This command returns the current zoom and focus values."""
21
+ data = [{"cmd" : "GetZoomFocus" , "action" : 0 , "param" : {"channel" : 0 }}]
22
+ return self ._execute_command ('GetZoomFocus' , data )
23
+
24
+ def start_zoom_pos (self , position : float ) -> Dict :
25
+ """This command sets the zoom position."""
26
+ data = [{"cmd" : "StartZoomFocus" , "action" : 0 , "param" : {"ZoomFocus" : {"channel" : 0 , "op" : "ZoomPos" , "pos" : position }}}]
27
+ return self ._execute_command ('StartZoomFocus' , data )
28
+
29
+ def start_focus_pos (self , position : float ) -> Dict :
30
+ """This command sets the focus position."""
31
+ data = [{"cmd" : "StartZoomFocus" , "action" : 0 , "param" : {"ZoomFocus" : {"channel" : 0 , "op" : "FocusPos" , "pos" : position }}}]
32
+ return self ._execute_command ('StartZoomFocus' , data )
33
+
34
+ def get_auto_focus (self ) -> Dict :
35
+ """This command returns the current auto focus status."""
36
+ data = [{"cmd" : "GetAutoFocus" , "action" : 0 , "param" : {"channel" : 0 }}]
37
+ return self ._execute_command ('GetAutoFocus' , data )
38
+
39
+ def set_auto_focus (self , disable : bool ) -> Dict :
40
+ """This command sets the auto focus status."""
41
+ data = [{"cmd" : "SetAutoFocus" , "action" : 0 , "param" : {"AutoFocus" : {"channel" : 0 , "disable" : 1 if disable else 0 }}}]
42
+ return self ._execute_command ('SetAutoFocus' , data )
43
+
19
44
def start_zooming_in (self , speed : float = 60 ) -> Dict :
20
45
"""
21
46
The camera zooms in until self.stop_zooming() is called.
0 commit comments