Skip to content

Commit

Permalink
Add Cruise command support (#805)
Browse files Browse the repository at this point in the history
K11016 Set Cruise

This command enables or disables the Pan Scan ("Cruise") behavior,
where the camera cycles through configured waypoints every 10 seconds.
  • Loading branch information
jhansche committed May 21, 2023
1 parent 5d134cf commit cc30800
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/wyzebridge/wyze_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"set_rotary_down": ("K11000SetRotaryByDegree", 0, -90),
"set_rotary_right": ("K11000SetRotaryByDegree", 90, 0),
"set_rotary_left": ("K11000SetRotaryByDegree", -90, 0),
"set_pan_cruise_on": ("K11016SetCruise", True),
"set_pan_cruise_off": ("K11016SetCruise", False),
"start_boa": ("K10148StartBoa",),
"get_motion_tagging": ("K10290GetMotionTagging",),
"set_motion_tagging_on": ("K10292SetMotionTagging", True),
Expand Down
16 changes: 16 additions & 0 deletions app/wyzecam/tutk/tutk_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,22 @@ def encode(self) -> bytes:
return encode(self.code, 1, bytes([self.position]))


class K11016SetCruise(TutkWyzeProtocolMessage):
"""
Set switch value for Pan Scan, aka Cruise.
Parameters:
:param enable: Optional Bool. Set True for on, False for off. Defaults to True.
"""

def __init__(self, enable: bool = True):
super().__init__(11016)
self.flag = 1 if enable else 2

def encode(self) -> bytes:
return encode(self.code, 1, bytes([self.enabled]))


class K11018SetPTZPosition(TutkWyzeProtocolMessage):
"""
Set PTZ Position.
Expand Down

0 comments on commit cc30800

Please sign in to comment.