Add clear DTC codes button to Pi DTC page (FEAT-15)

This commit is contained in:
Mathieu Moran
2026-08-13 16:40:15 -04:00
parent b39faadf58
commit e873db918d
8 changed files with 187 additions and 2 deletions
+10
View File
@@ -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())