Add clear DTC codes button to Pi DTC page (FEAT-15)
This commit is contained in:
@@ -440,6 +440,16 @@ def api_dtc():
|
||||
"codes": fresh_codes,
|
||||
})
|
||||
|
||||
@app.route('/api/dtc/clear', methods=['POST'])
|
||||
def api_dtc_clear():
|
||||
result = app_obd.clear_dtc_codes()
|
||||
status_codes = {
|
||||
"cleared": 200,
|
||||
"not_connected": 409,
|
||||
"error": 502,
|
||||
}
|
||||
return jsonify(result), status_codes.get(result["status"], 500)
|
||||
|
||||
@app.route('/api/stats')
|
||||
def api_stats():
|
||||
return jsonify(app_sql.get_overview_stats())
|
||||
|
||||
Reference in New Issue
Block a user