maybe fixxed power

Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>
master
Ebbe Baß 2022-05-16 21:36:58 +02:00
parent 520b374ace
commit 7bdbc9a737
1 changed files with 7 additions and 8 deletions

15
main.py
View File

@ -117,7 +117,6 @@ if __name__ == '__main__':
@app.route('/mode', methods=['GET'])
def mode():
global mode
global power
global r
global g
global b
@ -142,14 +141,14 @@ if __name__ == '__main__':
mode = 1
return 'Color: '+str(r)+','+str(g)+','+str(b)
@app.route('/power')
@app.route('/power', methods=['GET'])
def power():
if power == True:
power = False
return "Power off"
else:
power = True
return "Power on"
global power
power = request.args.get('power')
if power is None:
return 'No power argument specified'
elif power == "":
return 'No power argument specified'
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
strip.begin()