From 1e618efed09ab696584ae848fe85d73719defb4e Mon Sep 17 00:00:00 2001 From: waltem01 Date: Thu, 23 Nov 2023 10:49:03 +0100 Subject: [PATCH] clear without swap endpoint --- API/main.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/API/main.py b/API/main.py index 67126c8..64c47bd 100644 --- a/API/main.py +++ b/API/main.py @@ -99,6 +99,19 @@ def set_color(): return jsonify(response) +@api.route('/clear', methods=['GET']) +def update_matrix(): + response = { 'success': True } + + try: + global matrix + matrix.clear() + except Exception as e: + print(e) + response['success'] = False + + return jsonify(response) + @api.route('/update', methods=['GET']) def update_matrix(): response = { 'success': True }