Fix arguments
This commit is contained in:
parent
15fa7039e8
commit
5712f5cd51
pwnagotchi
@ -106,8 +106,8 @@ main:
|
|||||||
enabled: false
|
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
|
#The following is a list of the GPIO number for your button, and the command you want to run when it is pressed
|
||||||
gpios:
|
gpios:
|
||||||
- 20: 'sudo touch /root/.pwnagotchi-auto && sudo systemctl restart pwnagotchi'
|
20: 'touch /root/.pwnagotchi-auto && systemctl restart pwnagotchi'
|
||||||
- 21: 'shutdown -h now'
|
21: 'shutdown -h now'
|
||||||
# monitor interface to use
|
# monitor interface to use
|
||||||
iface: mon0
|
iface: mon0
|
||||||
# command to run to bring the mon interface up in case it's not up already
|
# 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
|
# set gpio numbering
|
||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
|
|
||||||
for i in gpios:
|
for gpio, command in gpios.items():
|
||||||
gpio = list(i)[0]
|
|
||||||
command = i[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=250)
|
GPIO.add_event_detect(gpio, GPIO.FALLING, callback=self.runCommand, bouncetime=250)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user