Adding function
This commit is contained in:
parent
b1c4f64af5
commit
cb2f92ee7c
1 changed files with 12 additions and 2 deletions
14
myapp.py
14
myapp.py
|
@ -151,8 +151,12 @@ def opener(lck):
|
||||||
requests.get("http://192.168.0.103/open")
|
requests.get("http://192.168.0.103/open")
|
||||||
|
|
||||||
def localtunnel_launcher(port=8000, wanted_subdomain="open-domodoor"):
|
def localtunnel_launcher(port=8000, wanted_subdomain="open-domodoor"):
|
||||||
result = subprocess.run(args="lt --port {} --subdomain {}".format(port,wanted_subdomain), shell=True, executable="/bin/bash")
|
while True:
|
||||||
print("Process returned:", result)
|
try:
|
||||||
|
result = subprocess.run(args="lt --port {} --subdomain {}".format(port,wanted_subdomain), shell=True, executable="/bin/bash")
|
||||||
|
print("Process returned:", result)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
break
|
||||||
|
|
||||||
def remote_handler(lck):
|
def remote_handler(lck):
|
||||||
n_attempts = 0
|
n_attempts = 0
|
||||||
|
@ -182,6 +186,12 @@ def remote_handler(lck):
|
||||||
print("Attempt "+str(n_attempts)+" fails in finding remote")
|
print("Attempt "+str(n_attempts)+" fails in finding remote")
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
|
def phone_number_to_long_format(number="0000000000"):
|
||||||
|
if len(number)==12 and number[0]=="+":
|
||||||
|
return number
|
||||||
|
elif len(number)==10:
|
||||||
|
return "+33"+number[1:]
|
||||||
|
|
||||||
#------ENDPOINTS------
|
#------ENDPOINTS------
|
||||||
|
|
||||||
@app.route(rule="/")
|
@app.route(rule="/")
|
||||||
|
|
Loading…
Reference in a new issue