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

@ -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: