parent
c46ff17401
commit
0d9e360468
9
main.py
9
main.py
|
@ -58,7 +58,10 @@ def setColor(strip, color, wait_ms=10):
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@app.route('/')
|
|
||||||
|
#api
|
||||||
|
|
||||||
|
@app.route('/api/')
|
||||||
def index():
|
def index():
|
||||||
return '''
|
return '''
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
@ -106,7 +109,7 @@ if __name__ == '__main__':
|
||||||
</html>
|
</html>
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@app.route('/mode', methods=['GET'])
|
@app.route('/api/mode', methods=['GET'])
|
||||||
def mode():
|
def mode():
|
||||||
global mode
|
global mode
|
||||||
global r
|
global r
|
||||||
|
@ -133,7 +136,7 @@ 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', methods=['GET'])
|
@app.route('/api/power', methods=['GET'])
|
||||||
def power():
|
def power():
|
||||||
global power
|
global power
|
||||||
power = request.args.get('power')
|
power = request.args.get('power')
|
||||||
|
|
Loading…
Reference in New Issue