fix: gpio needs to be a number

fixes gpio id as string in config
https://github.com/evilsocket/pwnagotchi/issues/643
This commit is contained in:
xenDE 2019-11-23 02:05:01 +01:00 committed by GitHub
parent a779fb9b0b
commit 83f741bbb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -32,6 +32,7 @@ class GPIOButtons(plugins.Plugin):
GPIO.setmode(GPIO.BCM)
for gpio, command in gpios.items():
gpio = int(gpio)
self.ports[gpio] = command
GPIO.setup(gpio, GPIO.IN, GPIO.PUD_UP)
GPIO.add_event_detect(gpio, GPIO.FALLING, callback=self.runCommand, bouncetime=600)