diff --git a/docs/PTZOptics-HTTP-CGI-Commands-Rev-14-08-20.pdf b/docs/PTZOptics-HTTP-CGI-Commands-Rev-14-08-20.pdf new file mode 100644 index 0000000..590fec7 Binary files /dev/null and b/docs/PTZOptics-HTTP-CGI-Commands-Rev-14-08-20.pdf differ diff --git a/visca_over_ip/camera.py b/visca_over_ip/camera.py index d23af5d..046975c 100644 --- a/visca_over_ip/camera.py +++ b/visca_over_ip/camera.py @@ -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. @@ -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')