Exemplo n.º 1
0
def lights():
	# Development
	#tc = RadioCommunication.RadioCommunication() #tellstick_comm.tellstick_comm()
	# Production	
	tc = tellstick_comm.tellstick_comm();
	device_id = request.form['light'] #i.light
	mode = request.form['mode'] #i.mode
	r = None
	
	if mode == '1':
		tc.turnOn(device_id)
	else:
		tc.turnOff(device_id)
	return (request.form['light'], r)
Exemplo n.º 2
0
	def __init__(self):
		self.db = dbal.DBAL()
		self.tc = tellstick_comm.tellstick_comm()