fixxed flask blueprint names
This commit is contained in:
+8
-8
@@ -5,7 +5,7 @@ from app.state import current_device, current_config
|
||||
|
||||
api_bp = Blueprint('api', __name__)
|
||||
|
||||
@app.route('/connect', methods=['POST'])
|
||||
@api_bp.route('/connect', methods=['POST'])
|
||||
def api_connect():
|
||||
global current_hub, current_module, current_device
|
||||
if current_config is None:
|
||||
@@ -63,7 +63,7 @@ def api_connect():
|
||||
pass
|
||||
|
||||
|
||||
@app.route('/reconnect', methods=['POST'])
|
||||
@api_bp.route('/reconnect', methods=['POST'])
|
||||
def api_reconnect():
|
||||
global current_device, current_module, current_hub
|
||||
if current_config is None:
|
||||
@@ -111,7 +111,7 @@ def api_reconnect():
|
||||
pass
|
||||
|
||||
|
||||
@app.route('/control', methods=['POST'])
|
||||
@api_bp.route('/control', methods=['POST'])
|
||||
def api_control():
|
||||
global current_device
|
||||
if current_device is None:
|
||||
@@ -155,7 +155,7 @@ def api_control():
|
||||
pass
|
||||
|
||||
|
||||
@app.route('/stop_all', methods=['POST'])
|
||||
@api_bp.route('/stop_all', methods=['POST'])
|
||||
def api_stop_all():
|
||||
global current_device
|
||||
if current_device is None:
|
||||
@@ -172,7 +172,7 @@ def api_stop_all():
|
||||
pass
|
||||
|
||||
|
||||
@app.route('/status', methods=['GET'])
|
||||
@api_bp.route('/status', methods=['GET'])
|
||||
def api_status():
|
||||
global current_device
|
||||
|
||||
@@ -189,7 +189,7 @@ def api_status():
|
||||
pass
|
||||
|
||||
|
||||
@app.route('/play_sound', methods=['POST'])
|
||||
@api_bp.route('/play_sound', methods=['POST'])
|
||||
def api_play_sound():
|
||||
try:
|
||||
data = request.get_json()
|
||||
@@ -232,7 +232,7 @@ def api_play_sound():
|
||||
pass
|
||||
|
||||
|
||||
@app.route('/stop_sound', methods=['POST'])
|
||||
@api_bp.route('/stop_sound', methods=['POST'])
|
||||
def api_stop_sound():
|
||||
try:
|
||||
pygame.mixer.music.stop()
|
||||
@@ -244,7 +244,7 @@ def api_stop_sound():
|
||||
pass
|
||||
|
||||
|
||||
@app.route('/set_volume', methods=['POST'])
|
||||
@api_bp.route('/set_volume', methods=['POST'])
|
||||
def api_set_volume():
|
||||
try:
|
||||
data = request.get_json()
|
||||
|
||||
Reference in New Issue
Block a user