Start filling routes stub
This commit is contained in:
18
rpi/main.py
18
rpi/main.py
@@ -2,7 +2,7 @@
|
||||
import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from flask import Flask
|
||||
from flask import Flask, jsonify
|
||||
|
||||
from hardware.light.lora_light_sensor_reader import LoraLightSensorReader
|
||||
from hardware.rfid.reader import RfidReader
|
||||
@@ -53,13 +53,21 @@ forward_service = ForwarderService(local_broker, api_broker)
|
||||
|
||||
@app.route("/command/party/start", methods=['POST'])
|
||||
def start_party():
|
||||
print("Party started!")
|
||||
pass
|
||||
try:
|
||||
print("Party started!")
|
||||
return jsonify({"status": "ok", "message": "Party started"}), 200
|
||||
except Exception as ex:
|
||||
print(e)
|
||||
return jsonify({"status": "error", "message": f"An error occurred : {e}"}), 500
|
||||
|
||||
@app.route("/command/party/play", methods=['POST'])
|
||||
def party_play():
|
||||
print("Move received !")
|
||||
pass
|
||||
try:
|
||||
print("Move received started!")
|
||||
return jsonify({"status": "ok", "message": "Party started"}), 200
|
||||
except Exception as ex:
|
||||
print(e)
|
||||
return jsonify({"status": "error", "message": f"An error occurred : {e}"}), 500
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
|
||||
Reference in New Issue
Block a user