Start filling routes stub
This commit is contained in:
16
rpi/main.py
16
rpi/main.py
@@ -2,7 +2,7 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
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.light.lora_light_sensor_reader import LoraLightSensorReader
|
||||||
from hardware.rfid.reader import RfidReader
|
from hardware.rfid.reader import RfidReader
|
||||||
@@ -53,13 +53,21 @@ forward_service = ForwarderService(local_broker, api_broker)
|
|||||||
|
|
||||||
@app.route("/command/party/start", methods=['POST'])
|
@app.route("/command/party/start", methods=['POST'])
|
||||||
def start_party():
|
def start_party():
|
||||||
|
try:
|
||||||
print("Party started!")
|
print("Party started!")
|
||||||
pass
|
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'])
|
@app.route("/command/party/play", methods=['POST'])
|
||||||
def party_play():
|
def party_play():
|
||||||
print("Move received !")
|
try:
|
||||||
pass
|
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__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user