Merge pull request #546 from dadav/fix/gpio-plugin
Fix options of gpio-plugin
This commit is contained in:
commit
8d8333b586
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user