
Text message to LED color with the Rascal, rascalmicro.com
By: a guest on
Nov 9th, 2011 | syntax:
Python | size: 0.32 KB | hits: 18 | expires: Never
@public.route('/sms', methods=['POST'])
def parse_sms():
import subprocess, webcolors
color = webcolors.name_to_rgb(request.form['Body'])
cmd = 'blinkm set-rgb -d 9 -r ' + str(color[0]) + ' -g ' + str(color[1]) + ' -b ' + str(color[2])
subprocess.Popen([cmd], shell=True)
return ('color sent to Blinkm')