fix: add /api/obd/status endpoint, dashboard OBD fallback on page load, fix GPS string-to-number crash
This commit is contained in:
@@ -139,6 +139,15 @@ def trips():
|
||||
def gps_status():
|
||||
return jsonify(app_gps.get_status())
|
||||
|
||||
@app.route('/api/obd/status')
|
||||
def obd_status():
|
||||
return jsonify({
|
||||
"adapter_present": bool(app_obd._find_obd_port()),
|
||||
"port": app_obd._find_obd_port(),
|
||||
"car_connected": app_obd._is_car_connected(),
|
||||
"status_label": "Connected" if app_obd._is_car_connected() else "Disconnected",
|
||||
})
|
||||
|
||||
@app.route('/api/trip/<int:trip_id>')
|
||||
def trip_route(trip_id):
|
||||
trip = app_sql.get_trip_route(trip_id)
|
||||
|
||||
Reference in New Issue
Block a user