Skip to content

set_motion_detection docstring and argument name #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2022
Merged
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
7 changes: 4 additions & 3 deletions adafruit_vc0706.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,12 @@ def get_motion_detect(self):
"""Query the gesture detection status"""
return self._run_command(_COMM_MOTION_STATUS, bytes([0x00]), 6)

def set_motion_detect(self, args):
def set_motion_detect(self, enabled):
"""Set gesture detection status.
args = 0 to unset, 1 to set

:param bool enabled: False to disable motion detected, True to enable motion detection.
"""
return self._run_command(_COMM_MOTION_CTRL, bytes([0x01, args]), 5)
return self._run_command(_COMM_MOTION_CTRL, bytes([0x01, enabled]), 5)

def _run_command(self, cmd, args, resplen, flush=True):
if flush:
Expand Down