def authcode(alexaId): code = request.args.get('code') userId = myApp.getUserIdFromAlexaId(alexaId) if st.smartThingsToken(alexaId, userId,code): print st.stData.getUser(userId).getClientInfo().token myApp.genNewAlexaId(userId,100) return redirect("/alexa")
def authcode(alexaId): code = request.args.get('code') userId = myApp.getUserIdFromAlexaId(alexaId) if st.smartThingsToken(alexaId, userId, code): print st.stData.getUser(userId).getClientInfo().token myApp.genNewAlexaId(userId, 100) return redirect("/alexa")
def samples(): if request.method == 'GET': return echopy_doc.samples_page.format(settings.full_root_url) if request.method == 'POST': try: alexaId=request.form['AlexaID'] userId = myApp.getUserIdFromAlexaId(alexaId) samples = st.getSamples(userId) myApp.genNewAlexaId(userId,100) return echopy_doc.samples_results.replace('RESULTS',samples.replace('\n',' ')).format(settings.full_root_url) except: return echopy_doc.samples_results.replace('RESULTS',"AN ERROR HAS ACCRUED").format(settings.full_root_url)
def authcode(alexaId): code = request.args.get('code') userId = myApp.getUserIdFromAlexaId(alexaId) if st.smartThingsToken(alexaId, userId,code): print "authed..." #print st.stData.getUser(userId).getClientInfo().token myApp.genNewAlexaId(userId,100) sendWelcomeEmail(userId) return redirect(settings.url_root)
def authcode(alexaId): code = request.args.get('code') userId = myApp.getUserIdFromAlexaId(alexaId) if st.smartThingsToken(alexaId, userId, code): print "authed..." #print st.stData.getUser(userId).getClientInfo().token myApp.genNewAlexaId(userId, 100) sendWelcomeEmail(userId) return redirect(settings.url_root)
def samples(): if request.method == 'GET': return echopy_doc.samples_page if request.method == 'POST': try: alexaId = request.form['AlexaID'] userId = myApp.getUserIdFromAlexaId(alexaId) samples = st.getSamples(userId) myApp.genNewAlexaId(userId, 100) return echopy_doc.samples_results.replace( 'RESULTS', samples.replace('\n', ' ')) except: return echopy_doc.samples_results.replace('RESULTS', "AN ERROR HAS ACCRUED")