From f81cae35817cbf6076ffa73f66e5d4feea5f0d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Tue, 4 Jan 2022 11:30:22 +0100 Subject: [PATCH] removed webapi --- main.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/main.py b/main.py index 3ebf6e4..ed4d839 100644 --- a/main.py +++ b/main.py @@ -3,13 +3,6 @@ import requests from rpi_ws281x import * import RPi.GPIO as GPIO import os -try: - from flask import Flask, request -except: - os.system('pip3 install Flask') - os.system('sudo pip3 install Flask') - from flask import Flask, request -import threading # LED strip configuration: LED_COUNT = 60 # Number of LED pixels. @@ -73,23 +66,7 @@ def power_toggle(channel): power_button_pressed = 'True' print('Toggle Power executed') -#Web API -app = Flask(__name__) - -@app.route('/') -def index(): - command = str(request.args.get('command')) - if command == "switch-ilde-mode": - print('Switched Idlemode via API') - change_idle_mode - elif command == "switch-toggle-on-off": - print('Toggled Power via API') - power_toggle - - return command - if __name__ == '__main__': - threading.Thread(target=app.run(host="0.0.0.0", port=80, use_reloader=False)).start() led_power = 'True' idle_mode = 1