Skip to content

Commit

Permalink
Merge pull request #31 from TechnoSwiss/main
Browse files Browse the repository at this point in the history
Fix bug with increased presets where send_command preset value upper nibble was fixed at 0
  • Loading branch information
misterhay authored Dec 2, 2024
2 parents 03542f6 + 9b754ac commit e2dd4ae
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions visca_over_ip/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,16 +606,16 @@ def defog(self, mode: bool):
self._send_command('04 37 03 00')

def save_preset(self, preset_num: int):
"""Saves many of the camera's settings in one of 16 slots (some cameras even have 128 or 129 slots)"""
if not 0 <= preset_num <= 128:
raise ValueError('Preset number must be 0-128 inclusive')
self._send_command(f'04 3F 01 0{preset_num:x}')
"""Saves many of the camera's settings in one of 16 slots (some cameras even have as many as 255 slots)"""
if not 0 <= preset_num <= 255:
raise ValueError('Preset number must be 0-255 inclusive')
self._send_command(f'04 3F 01 {preset_num:02x}')

def recall_preset(self, preset_num: int):
"""Instructs the camera to recall one of the 16 saved presets"""
if not 0 <= preset_num <= 128:
raise ValueError('Preset number must be 0-128 inclusive')
self._send_command(f'04 3F 02 0{preset_num:x}')
"""Instructs the camera to recall one of the 255 saved presets"""
if not 0 <= preset_num <= 255:
raise ValueError('Preset number must be 0-255 inclusive')
self._send_command(f'04 3F 02 {preset_num:02x}')

@staticmethod
def _zero_padded_bytes_to_int(zero_padded: bytes, signed=True) -> int:
Expand Down

0 comments on commit e2dd4ae

Please sign in to comment.