Esempio n. 1
0
	def POST(self, device, status):
		hdrs = web.input()
		if(hdrs["secret"]!=config.get_pwd()):
			return "Wrong secret"
		global room
		web.header('Access-Control-Allow-Origin','*')
		web.header('Access-Control-Allow-Credentials', 'true')
		return room.setDevice(device, status)
Esempio n. 2
0
	def GET(self, device):
		print "Request for device " + device + " status"
		hdrs = web.input()
		if(hdrs["secret"]!=config.get_pwd()):
			return 401
		global room
		web.header('Access-Control-Allow-Origin','*')
		web.header('Access-Control-Allow-Credentials', 'true')
		return room.getDevice(device)