#! /usr/bin/python

import time

time.sleep(20)

from flask import Flask

app = Flask(__name__)

from blinkstick import blinkstick

bsticks = blinkstick.find_all()

b = bsticks[0]

@app.route(‘/’)

def index():

        for bstick in bsticks:

                b.turn_off()

        return ‘Blinkstick Off’

@app.route(‘/green’)

def green():

        for bstick in bsticks:

                b.set_color(hex=‘#008C00’)

        return ‘Blinkstick GREEN’

@app.route(‘/red’)

def red():

        for bstick in bsticks:

                b.set_color(hex=‘#DC0000’)

        return ‘Blinkstick MEETING’

@app.route(‘/yellow’)

def test():

        for bstick in bsticks:

                b.set_color(hex=‘#FFFb00’)

        return ‘Blinkstick Yellow’

@app.route(‘/white’)

def info():

        for bstick in bsticks:

                b.set_color(hex=‘#ffffff’)

        return ‘White’  

@app.route(‘/blue’)

def blue():

        for bstick in bsticks:

                b.set_color(hex=‘#0076ba’)

        return ‘Blue’  

if __name__ == ‘__main__’:

    app.run(debug=True, host=‘0.0.0.0’)

Leave a Reply

Your email address will not be published. Required fields are marked *