ci provisioning: Use strings instead of "magic numbers" for connection state
This commit is contained in:
@@ -87,9 +87,9 @@ def test_examples_provisioning_ble(env, extra_data):
|
||||
time.sleep(5)
|
||||
print("Wi-Fi connection state")
|
||||
ret = esp_prov.get_wifi_config(transport, security)
|
||||
if (ret == 1):
|
||||
if (ret == "connecting"):
|
||||
continue
|
||||
elif (ret == 0):
|
||||
elif (ret == "connected"):
|
||||
print("Provisioning was successful")
|
||||
success = True
|
||||
break
|
||||
|
||||
@@ -101,9 +101,9 @@ def test_examples_provisioning_softap(env, extra_data):
|
||||
time.sleep(5)
|
||||
print("Wi-Fi connection state")
|
||||
ret = esp_prov.get_wifi_config(transport, security)
|
||||
if (ret == 1):
|
||||
if (ret == "connecting"):
|
||||
continue
|
||||
elif (ret == 0):
|
||||
elif (ret == "connected"):
|
||||
print("Provisioning was successful")
|
||||
success = True
|
||||
break
|
||||
|
||||
@@ -96,12 +96,12 @@ def test_examples_wifi_prov_mgr(env, extra_data):
|
||||
time.sleep(5)
|
||||
print("Wi-Fi connection state")
|
||||
ret = esp_prov.get_wifi_config(transport, security)
|
||||
if (ret == 1):
|
||||
if (ret == "connecting"):
|
||||
continue
|
||||
elif (ret == 0):
|
||||
elif (ret == "connected"):
|
||||
print("Provisioning was successful")
|
||||
success = True
|
||||
elif (ret == 3 and retry < 3):
|
||||
elif (ret == "failed" and retry < 3):
|
||||
retry = retry + 1
|
||||
print("Connection failed.. retry again...: ", ret)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user