Add OPTIONS to gps-plugin

This commit is contained in:
dadav 2019-10-07 23:35:18 +02:00
parent 2083b68f29
commit 80e307d28d
2 changed files with 5 additions and 4 deletions

View File

@ -31,6 +31,8 @@ main:
- 'scp /tmp/backup.tar.gz pwnagotchi@10.0.0.1:/home/pwnagotchi/backups/backup-$(date +%s).tar.gz' - 'scp /tmp/backup.tar.gz pwnagotchi@10.0.0.1:/home/pwnagotchi/backups/backup-$(date +%s).tar.gz'
gps: gps:
enabled: false enabled: false
speed: 19200
device: /dev/ttyUSB0
twitter: twitter:
enabled: false enabled: false
consumer_key: aaa consumer_key: aaa

View File

@ -8,9 +8,8 @@ import logging
import json import json
import os import os
device = '/dev/ttyUSB0'
speed = 19200
running = False running = False
OPTIONS = dict()
def on_loaded(): def on_loaded():
@ -27,8 +26,8 @@ def on_ready(agent):
except: except:
pass pass
agent.run('set gps.device %s' % device) agent.run('set gps.device %s' % OPTIONS['device'])
agent.run('set gps.speed %d' % speed) agent.run('set gps.speed %d' % OPTIONS['speed'])
agent.run('gps on') agent.run('gps on')
running = True running = True
else: else: