From 80e307d28dd36261f7f5e8098255044792985d7c Mon Sep 17 00:00:00 2001 From: dadav <33197631+dadav@users.noreply.github.com> Date: Mon, 7 Oct 2019 23:35:18 +0200 Subject: [PATCH] Add OPTIONS to gps-plugin --- pwnagotchi/defaults.yml | 2 ++ pwnagotchi/plugins/default/gps.py | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pwnagotchi/defaults.yml b/pwnagotchi/defaults.yml index 330218f..62a70eb 100644 --- a/pwnagotchi/defaults.yml +++ b/pwnagotchi/defaults.yml @@ -31,6 +31,8 @@ main: - 'scp /tmp/backup.tar.gz pwnagotchi@10.0.0.1:/home/pwnagotchi/backups/backup-$(date +%s).tar.gz' gps: enabled: false + speed: 19200 + device: /dev/ttyUSB0 twitter: enabled: false consumer_key: aaa diff --git a/pwnagotchi/plugins/default/gps.py b/pwnagotchi/plugins/default/gps.py index f7aa56e..c49b926 100644 --- a/pwnagotchi/plugins/default/gps.py +++ b/pwnagotchi/plugins/default/gps.py @@ -8,9 +8,8 @@ import logging import json import os -device = '/dev/ttyUSB0' -speed = 19200 running = False +OPTIONS = dict() def on_loaded(): @@ -27,8 +26,8 @@ def on_ready(agent): except: pass - agent.run('set gps.device %s' % device) - agent.run('set gps.speed %d' % speed) + agent.run('set gps.device %s' % OPTIONS['device']) + agent.run('set gps.speed %d' % OPTIONS['speed']) agent.run('gps on') running = True else: