Try stuff
This commit is contained in:
15
rpi/main.py
15
rpi/main.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user