Update to tsDriver to attempt to locate via gps

This commit is contained in:
Patrick McDonagh
2016-03-01 12:53:25 -06:00
parent a8e9bec928
commit 9de66f60ce

View File

@@ -73,19 +73,23 @@ def setupChannels():
class start(threading.Thread, deviceBase):
def updateGPS(self):
gps = self.mcu.gps
print("GPS found me at {0}".format(gps))
self.sendtodb("gps", gps, 0)
def __init__(self, name=None, number=None, mac=None, Q=None, mcu=None, companyId=None, offset=None, mqtt=None, Nodes=None):
threading.Thread.__init__(self)
deviceBase.__init__(self, name=name, number=number, mac=mac, Q=Q, mcu=mcu, companyId=companyId, offset=offset, mqtt=mqtt, Nodes=Nodes)
self.daemon = True
self.version = "1"
self.version = "3"
self.device_address = addr
self.finished = threading.Event()
threading.Thread.start(self)
self.sendtodbJSON("device_address", self.device_address, 0)
setupChannels()
self.updateGPS()
# this is a required function for all drivers, its goal is to upload some piece of data
# about your device so it can be seen on the web
def register(self):
@@ -139,8 +143,7 @@ class start(threading.Thread, deviceBase):
self.device_address = value
return True
def tagserver_gpsUpdate(self, name, value):
gps = self.mcu.gps
print("GPS found me at {0}".format(gps))
self.sendtodb("gps", gps, 0)
updateGPS()
return True