def illuminate(): """Full white illumination mode.""" m.reset() p.currbright = 1 m.strip.brightness = p.currbright m.illuminate() return redirect(url_for('root'))
def text(): """Display text on the screen.""" m.reset() # The ifs here are so we don't necessarily need all the arguments. text = request.args.get('text') if text != None: p.currtext = request.args.get('text') bright = request.args.get('brightness') if bright != None: p.currbright = float(bright) if 0 <= p.currbright <= 1: m.strip.brightness = p.currbright color = request.args.get('color') if color != None: p.currcolor = color m.text(p.currtext, m.color[p.currcolor]) return redirect(url_for('root'))
def ip(): """Display our local WiFI IP.""" p.currtext = ourip() m.reset() m.text(p.currtext, m.color[p.currcolor]) return redirect(url_for('root'))
def reset(): """Reset (clear) the screen.""" p.currtext = '' m.reset() return redirect(url_for('root'))
def signal_handler(signal, frame): scheduled.stop() m.reset() sys.exit(0)