Merge pull request #566 from xenDE/master
prevent double execution on gpio buttons
This commit is contained in:
commit
a5ed09cd08
@ -34,5 +34,5 @@ class GPIOButtons(plugins.Plugin):
|
|||||||
for gpio, command in gpios.items():
|
for gpio, command in gpios.items():
|
||||||
self.ports[gpio] = command
|
self.ports[gpio] = command
|
||||||
GPIO.setup(gpio, GPIO.IN, GPIO.PUD_UP)
|
GPIO.setup(gpio, GPIO.IN, GPIO.PUD_UP)
|
||||||
GPIO.add_event_detect(gpio, GPIO.FALLING, callback=self.runCommand, bouncetime=250)
|
GPIO.add_event_detect(gpio, GPIO.FALLING, callback=self.runCommand, bouncetime=600)
|
||||||
logging.info("Added command: %s to GPIO #%d", command, gpio)
|
logging.info("Added command: %s to GPIO #%d", command, gpio)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user