Fix arguments

This commit is contained in:
dadav 2019-11-07 07:37:41 +01:00
parent 15fa7039e8
commit 5712f5cd51
2 changed files with 3 additions and 5 deletions
pwnagotchi

@ -106,8 +106,8 @@ main:
enabled: false
#The following is a list of the GPIO number for your button, and the command you want to run when it is pressed
gpios:
- 20: 'sudo touch /root/.pwnagotchi-auto && sudo systemctl restart pwnagotchi'
- 21: 'shutdown -h now'
20: 'touch /root/.pwnagotchi-auto && systemctl restart pwnagotchi'
21: 'shutdown -h now'
# monitor interface to use
iface: mon0
# command to run to bring the mon interface up in case it's not up already

@ -31,9 +31,7 @@ class GPIOButtons(plugins.Plugin):
# set gpio numbering
GPIO.setmode(GPIO.BCM)
for i in gpios:
gpio = list(i)[0]
command = i[gpio]
for gpio, command in gpios.items():
self.ports[gpio] = command
GPIO.setup(gpio, GPIO.IN, GPIO.PUD_UP)
GPIO.add_event_detect(gpio, GPIO.FALLING, callback=self.runCommand, bouncetime=250)