make connection wait loop more readable

| is the bitwise or operator, you rather want a logical operator here.
pull/3/head
Thomas Waldmann 2017-12-11 15:18:39 +01:00
rodzic 72292a72ab
commit 28e2aa5001
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -11,10 +11,10 @@ def do_connect(ntwrk_ssid, netwrk_pass):
if not sta_if.isconnected():
print('Trying to connect to %s...' % ntwrk_ssid)
sta_if.connect(ntwrk_ssid, netwrk_pass)
a = 0
while not sta_if.isconnected() | (a > 99):
retry = 0
while not sta_if.isconnected() and retry < 100:
time.sleep(0.1)
a += 1
retry += 1
print('.', end='')
if sta_if.isconnected():
print('\nConnected. Network config: ', sta_if.ifconfig())