Example #1
0
@app.route("/alexa/auth/<path:path>", methods=['GET'])
def auth(path):

    auth_uri = nest.nestAuth(path)
    return redirect(auth_uri)


@app.route("/alexa/oauth2", methods=['GET'])
def authcode():
    user = request.args.get('state')
    code = request.args.get('code')

    if nest.nestToken(user, code):

        print nest.nestData.getUser(user).getToken()

    return redirect("/alexa")


def run_echopy_app():
    import SocketServer
    #SocketServer.BaseServer.handle_error = close_stream
    SocketServer.ThreadingTCPServer.allow_reuse_address = True
    echopy_app.run(app)


if __name__ == "__main__":
    nest.nestDataStoreInit()
    myApp.data_init()
    run_echopy_app()
Example #2
0
def auth(path):

	auth_uri = nest.nestAuth(path)
	return redirect(auth_uri)

@app.route("/alexa/oauth2",methods = ['GET'])
def authcode():
	user = request.args.get('state')
	code = request.args.get('code')

	if nest.nestToken(user,code):

		print nest.nestData.getUser(user).getToken()

	return redirect("/alexa")




def run_echopy_app():
	import SocketServer
	#SocketServer.BaseServer.handle_error = close_stream
	SocketServer.ThreadingTCPServer.allow_reuse_address = True
	echopy_app.run(app)


if __name__ == "__main__":
	nest.nestDataStoreInit()
	myApp.data_init()
	run_echopy_app()
Example #3
0
def sendWelcomeEmail(userId):
	userEmail = myApp.getUserEmail(userId)
	msg = Message(
			  'ZPriddy - Alexa Support',
		   sender='*****@*****.**',
		   recipients=
			   [userEmail])
	msg.body = '''
	Welcome to ZPriddy Alexa SmartThings! This is a conformation that your account has been created and is linked to your SmartThings account! 

	Comming Soon: Better Support! :) 
	'''
	mail.send(msg)

def run_echopy_app():
	import SocketServer
	#SocketServer.BaseServer.handle_error = close_stream
	SocketServer.ThreadingTCPServer.allow_reuse_address = True
	echopy_app.run(app)



if __name__ == "__main__":
	st.smartThingsMongoDBInit()
	nest.nestDBInit()
	logger.init_logging()
	myApp.data_init()
	nestApp.data_init()
	run_echopy_app()
Example #4
0
###############################################################################


def sendWelcomeEmail(userId):
    userEmail = myApp.getUserEmail(userId)
    msg = Message('ZPriddy - Alexa Support',
                  sender='*****@*****.**',
                  recipients=[userEmail])
    msg.body = '''
	Welcome to ZPriddy Alexa SmartThings! This is a conformation that your account has been created and is linked to your SmartThings account! 

	Comming Soon: Better Support! :) 
	'''
    mail.send(msg)


def run_echopy_app():
    import SocketServer
    #SocketServer.BaseServer.handle_error = close_stream
    SocketServer.ThreadingTCPServer.allow_reuse_address = True
    echopy_app.run(app)


if __name__ == "__main__":
    st.smartThingsMongoDBInit()
    nest.nestDBInit()
    logger.init_logging()
    myApp.data_init()
    nestApp.data_init()
    run_echopy_app()