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