add app_dash.py and some files
This commit is contained in:
+12
-21
@@ -1,27 +1,18 @@
|
||||
import app_car as Car
|
||||
import threading, app_events
|
||||
from threading import Thread
|
||||
|
||||
account_car = Car()
|
||||
account_car.model = "YARIS"
|
||||
socketio = app_events.SocketIO()
|
||||
account_name = "quoije"
|
||||
account_pp_image = "static\img\image.png"
|
||||
account_info = ["name","pp_image", "car_model"]
|
||||
account_car = Car
|
||||
account_car.model = "YARIS"
|
||||
account_lock = threading.Lock()
|
||||
|
||||
class Account:
|
||||
def __init__(self):
|
||||
self.name = "quoije"
|
||||
self.pp_image = None
|
||||
self.car = account_car.model
|
||||
|
||||
def account_info():
|
||||
obd_speed_lock.acquire()
|
||||
cmd = obd.commands.GET_DTC # select an OBD command (sensor)
|
||||
response = connection.query(cmd) # send the command and parse the response
|
||||
try:
|
||||
if response.is_null():
|
||||
error_txt = "No data received."
|
||||
print(error_txt)
|
||||
socketio.emit('obd_dtc', error_txt)
|
||||
else:
|
||||
print(response.value)
|
||||
socketio.emit('obd_dtc', response.value)
|
||||
finally:
|
||||
obd_rpm_lock.release()
|
||||
self.name = account_name
|
||||
self.pp_image = account_pp_image
|
||||
self.car = account_car
|
||||
def info():
|
||||
return [name, pp_image, car.model]
|
||||
Reference in New Issue
Block a user