Merge pull request #566 from xenDE/master

prevent double execution on gpio buttons
This commit is contained in:
evilsocket
2019-11-10 13:10:49 +01:00
committed by GitHub

View File

@ -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)