- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
def pause(c): #replace, assist
if c > 100: waitLong(c)
elif c== 1: wait1s()
elif c== 2: wait2s()
elif c== 3: wait3s()
elif c== 5: wait5s()
elif c== 8: wait8s()
elif c== 10: wait10s()
else:
logger.debug(f"custom timeout, need recheck({c})")
p(c) #ping raspberry instead of direct sleep
def p(c):
time.sleep(c)
def wait1s():
p(1)
def wait2s():
wait1s()
wait1s()
def wait3s():
logger.debug("one, two, three")
p(3)
def wait5s():
logger.debug("5, 4, 3, 2, 1..")
p(5)
def wait8s():
wait5s()
wait3s()
def wait10s():
wait5s()
wait5s()
def waitLong(c):
logger.debug(f"Attention, wait time is too long({c}), need to replace with waiting for some event or ping")
p(c)
def cc():
global client
client.connect()
return(client)