parent
a1320aa210
commit
186eed295b
18
main.py
18
main.py
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue