Skip to content

Commit 2909639

Browse files
committed
get and set autofocus
1 parent b4d3c0e commit 2909639

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

reolinkapi/mixins/zoom.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ def start_focus_pos(self, position: float) -> Dict:
3131
data = [{"cmd": "StartZoomFocus", "action": 0, "param": {"ZoomFocus": {"channel": 0, "op": "FocusPos", "pos": position}}}]
3232
return self._execute_command('StartZoomFocus', data)
3333

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": {"channel": 0, "disable": disable}}]
42+
return self._execute_command('SetAutoFocus', data)
43+
3444
def start_zooming_in(self, speed: float = 60) -> Dict:
3545
"""
3646
The camera zooms in until self.stop_zooming() is called.

0 commit comments

Comments
 (0)