Added safety checker debug
This commit is contained in:
+5
-1
@@ -157,7 +157,7 @@ def telemetry():
|
|||||||
return jsonify({"error": f"Database error: {str(e)}"}), 500
|
return jsonify({"error": f"Database error: {str(e)}"}), 500
|
||||||
|
|
||||||
|
|
||||||
@app.route("/debug", methods=["GET"])
|
@app.route("/debug/telemetryrequest", methods=["GET"])
|
||||||
def debug():
|
def debug():
|
||||||
# Construct external HTTP endpoint dynamically based on incoming request host
|
# Construct external HTTP endpoint dynamically based on incoming request host
|
||||||
telemetry_url = f"{request.host_url.rstrip('/')}/telemetry"
|
telemetry_url = f"{request.host_url.rstrip('/')}/telemetry"
|
||||||
@@ -176,6 +176,10 @@ def debug():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
return jsonify({"error": f"Failed to publish MQTT command: {str(e)}"}), 500
|
return jsonify({"error": f"Failed to publish MQTT command: {str(e)}"}), 500
|
||||||
|
|
||||||
|
@app.route("/debug", methods=["GET"])
|
||||||
|
def debug():
|
||||||
|
return safety_checker.check_dish_safety(os.path.join(CAMERA_IMAGE_DIR, "dish_0de0ee1dab8949fc8e78796947e24ed3.jpg"))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(debug=getattr(config, "DEBUG", True))
|
app.run(debug=getattr(config, "DEBUG", True))
|
||||||
Reference in New Issue
Block a user