Skip to content

Commit

Permalink
docs: update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed May 6, 2024
1 parent 76ad161 commit f6505a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/gpio_control/GPIODevices/simple_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,21 @@ def _handleCallbackFunction(self, *args):
logger.info('{}: handleCallbackFunction, mode: {}'.format(self.name, self.hold_mode))

if self.hold_mode == "Repeat":
# Repeated call of main action (instantly and multiple times if button is held long enough)
# Repeated call of primary action (instantly and multiple times if button is held long enough)
self.when_pressed(*args)
while checkGpioStaysInState(self.hold_time, self.pin, GPIO.LOW):
self.when_pressed(*args)

elif self.hold_mode == "Postpone":
# Postponed call of main action (once)
# Postponed call of primary action (once)
if checkGpioStaysInState(self.hold_time, self.pin, GPIO.LOW):
self.when_pressed(*args)
while checkGpioStaysInState(self.hold_time, self.pin, GPIO.LOW):
pass

elif self.hold_mode == "SecondFunc":
# Call of secondary action (once)
# execute main action if not held past hold_time
# execute primary action if not held past hold_time
if checkGpioStaysInState(self.hold_time, self.pin, GPIO.LOW):
self.when_held(*args)
while checkGpioStaysInState(self.hold_time, self.pin, GPIO.LOW):
Expand All @@ -160,7 +160,7 @@ def _handleCallbackFunction(self, *args):

elif self.hold_mode == "SecondFuncRepeat":
# Repeated call of secondary action (multiple times if button is held long enough)
# execute main action if not held past hold_time
# execute primary action if not held past hold_time
if checkGpioStaysInState(self.hold_time, self.pin, GPIO.LOW):
self.when_held(*args)
while checkGpioStaysInState(self.hold_time, self.pin, GPIO.LOW):
Expand Down

0 comments on commit f6505a7

Please sign in to comment.