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:
parent
a779fb9b0b
commit
83f741bbb0
@ -32,6 +32,7 @@ class GPIOButtons(plugins.Plugin):
|
|||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
|
|
||||||
for gpio, command in gpios.items():
|
for gpio, command in gpios.items():
|
||||||
|
gpio = int(gpio)
|
||||||
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=600)
|
GPIO.add_event_detect(gpio, GPIO.FALLING, callback=self.runCommand, bouncetime=600)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user