added r g b

Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>
master
Ebbe Baß 2022-05-16 21:06:13 +02:00
parent a1320aa210
commit 186eed295b
1 changed files with 12 additions and 6 deletions

18
main.py
View File

@ -117,18 +117,24 @@ if __name__ == '__main__':
def mode():
args = request.args
mode = args.get('mode')
color = args.get('color')
if mode is None or color is None:
r = args.get('r')
g = args.get('g')
b = args.get('b')
if mode is None:
return 'No mode specified'
elif mode == "" or color == "":
elif mode == "":
return 'No mode specified'
elif mode == "0":
mode = 0
return 'Rainbow Cycle'
elif mode == "1":
mode = 1
return color
# return 'Set Color'
if r is None or g is None or b is None:
return 'No color specified'
elif r == "" or g == "" or b == "":
return 'No color specified'
else:
mode = 1
return 'Color: '+str(r)+','+str(g)+','+str(b)
@app.route('/power', methods=['GET'])
def power():