Try stuff

This commit is contained in:
2025-12-31 14:19:00 +01:00
parent 0b4ba75a36
commit 2286108be1
4 changed files with 34 additions and 37 deletions

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env python3
import os
import cv2
import requests
from dotenv import load_dotenv
from flask import Flask, jsonify
@@ -62,7 +64,18 @@ def start_party():
@app.route("/command/party/play", methods=['POST'])
def make_move():
try:
game_service.make_move()
frame, fen = game_service.make_move()
print(fen)
encoded_frame = cv2.imencode('.jpg', frame)
image_bytes = encoded_frame[1].tobytes()
headers = {'Content-Type': 'image/jpeg'}
response = requests.post(
"https://192.168.15.125:1880/party/image",
data=image_bytes,
headers=headers,
verify=False)
print(response.status_code)
return jsonify({"status": "ok", "message": "Party started"}), 200
except Exception as ex:
print(ex)