def main(): if (zp_st.getHostUrl() == None): print("Trying to set Host URL") zp_st.setHostUrl() if (zp_st.getHostUrl() == None): print("Error setting Host URL") exit() if (zp_st.initd()): return render_template('main.html', title='ZP SmartThings PyDash') else: return redirect("/auth/")
def callback(): authcode = request.args.get('code', '') redirecturl = zp_st.authSecond( authcode, "http://" + zp_st.getHostUrl() + "/callback") return redirect(redirecturl)
def reauth(): print("auth..") redirecturl = zp_st.reauth("http://" + zp_st.getHostUrl() + "/callback") return redirect(redirecturl)
def auth(): print("auth..") zp_st.initST() redirecturl = zp_st.authInit("http://" + zp_st.getHostUrl() + "/callback") return redirect(redirecturl)