add gps function

This commit is contained in:
quoije
2024-03-17 22:37:25 -04:00
parent 4bc184fcdf
commit bdf6bb477b
13 changed files with 157 additions and 82 deletions
+22
View File
@@ -0,0 +1,22 @@
from app_events import socketio
from threading import Thread
class GPS:
def __init__(self):
self.LocationX = None
self.LocationY= None
@socketio.on('gps')
def get_gps():
global LocationX
global LocationY
LocationX = "45.5202844"
LocationY = "-73.5493208"
Location = [LocationX, LocationY]
socketio.emit('gps_location', Location)
print("websocket should be sent now")
return print("socket.io emitted")