Skip to content

Commit b4d3c0e

Browse files
committed
zoom and focus commands
1 parent 53e053b commit b4d3c0e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

reolinkapi/mixins/zoom.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ def _stop_zooming_or_focusing(self) -> Dict:
1616
data = [{"cmd": "PtzCtrl", "action": 0, "param": {"channel": 0, "op": "Stop"}}]
1717
return self._execute_command('PtzCtrl', data)
1818

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+
1934
def start_zooming_in(self, speed: float = 60) -> Dict:
2035
"""
2136
The camera zooms in until self.stop_zooming() is called.

0 commit comments

Comments
 (0)