Add sensor fault simulation and health display

This commit is contained in:
root
2026-06-03 00:22:57 -06:00
parent fbac6063b9
commit cdff42ddd4
4 changed files with 134 additions and 31 deletions
+14
View File
@@ -68,5 +68,19 @@ def toggle_ignition():
})
@app.route("/sensor/<name>/fault", methods=["POST"])
def toggle_sensor_fault(name):
failed = esp32.toggle_sensor_fault(name)
if failed is None:
return jsonify({"success": False, "error": "Unknown sensor"}), 404
return jsonify({
"success": True,
"sensor": name,
"failed": failed
})
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000, debug=True)