Skip to content

Commit 780bdef

Browse files
committed
Convert motion detection getter/setter to property
1 parent c13715b commit 780bdef

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

adafruit_vc0706.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,13 @@ def motion_detected(self):
221221
return False
222222
return True
223223

224-
def get_motion_detect(self):
225-
"""Query the gesture detection status"""
224+
@property
225+
def motion_detection(self):
226+
"""The gesture detection status"""
226227
return self._run_command(_COMM_MOTION_STATUS, bytes([0x00]), 6)
227228

228-
def set_motion_detect(self, enabled):
229-
"""Set gesture detection status.
230-
231-
:param bool enabled: False to disable motion detected, True to enable motion detection.
232-
"""
229+
@motion_detection.setter
230+
def motion_detection(self, enabled):
233231
return self._run_command(_COMM_MOTION_CTRL, bytes([0x01, enabled]), 5)
234232

235233
def _run_command(self, cmd, args, resplen, flush=True):

0 commit comments

Comments
 (0)