Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/PTZOptics-HTTP-CGI-Commands-Rev-14-08-20.pdf
Binary file not shown.
28 changes: 27 additions & 1 deletion visca_over_ip/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,32 @@ def set_autofocus_mode(self, mode: str):

self._send_command('04 57 0' + modes[mode])

def set_af_sense(self, mode: str):
modes = {
'high': '1',
'normal': '2',
'low': '3'
}

mode = mode.lower()
if mode not in modes:
raise ValueError(f'"{mode}" is not a valid mode. Valid modes: {", ".join(modes.keys())}')

self._send_command('04 58 0' + modes[mode])

def set_af_zone(self, mode: str):
modes = {
'top': '0',
'center': '1',
'bottom': '2'
}

mode = mode.lower()
if mode not in modes:
raise ValueError(f'"{mode}" is not a valid mode. Valid modes: {", ".join(modes.keys())}')

self._send_command('04 AA 0' + modes[mode])

def set_autofocus_interval(self, active_time: int, interval_time: int):
"""Sets the autofocus interval of the camera
:param active_time in seconds, interval_time in seconds.
Expand Down Expand Up @@ -474,7 +500,7 @@ def set_shutter(self, shutter: int):
if not isinstance(shutter, int) or shutter < 0 or shutter > 21:
raise ValueError('The shutter must be an integer from 0 to 21 inclusive')

self._send_command('04 4A 00 ' + f'{shutter:02x}')
self._send_command('04 4A 00 00 00 ' + f'{shutter:02x}')

def increase_shutter(self):
self._send_command('04 0A 02')
Expand Down