parent
a1320aa210
commit
186eed295b
16
main.py
16
main.py
|
@ -117,18 +117,24 @@ if __name__ == '__main__':
|
||||||
def mode():
|
def mode():
|
||||||
args = request.args
|
args = request.args
|
||||||
mode = args.get('mode')
|
mode = args.get('mode')
|
||||||
color = args.get('color')
|
r = args.get('r')
|
||||||
if mode is None or color is None:
|
g = args.get('g')
|
||||||
|
b = args.get('b')
|
||||||
|
if mode is None:
|
||||||
return 'No mode specified'
|
return 'No mode specified'
|
||||||
elif mode == "" or color == "":
|
elif mode == "":
|
||||||
return 'No mode specified'
|
return 'No mode specified'
|
||||||
elif mode == "0":
|
elif mode == "0":
|
||||||
mode = 0
|
mode = 0
|
||||||
return 'Rainbow Cycle'
|
return 'Rainbow Cycle'
|
||||||
elif mode == "1":
|
elif mode == "1":
|
||||||
|
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
|
mode = 1
|
||||||
return color
|
return 'Color: '+str(r)+','+str(g)+','+str(b)
|
||||||
# return 'Set Color'
|
|
||||||
|
|
||||||
@app.route('/power', methods=['GET'])
|
@app.route('/power', methods=['GET'])
|
||||||
def power():
|
def power():
|
||||||
|
|
Loading…
Reference in New Issue