Exemplo n.º 1
0
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/")
Exemplo n.º 2
0
def callback():
    authcode = request.args.get('code', '')
    redirecturl = zp_st.authSecond(
        authcode, "http://" + zp_st.getHostUrl() + "/callback")
    return redirect(redirecturl)
Exemplo n.º 3
0
def reauth():
    print("auth..")
    redirecturl = zp_st.reauth("http://" + zp_st.getHostUrl() + "/callback")
    return redirect(redirecturl)
Exemplo n.º 4
0
def auth():
    print("auth..")
    zp_st.initST()
    redirecturl = zp_st.authInit("http://" + zp_st.getHostUrl() + "/callback")
    return redirect(redirecturl)