ble.py - removing try block from history
This commit is contained in:
1 parent
725cf29a71
commit
75542dc962
1 file changed
+13
-16
+13
-16
@@ -294,22 +294,19 @@ def test(test_count = 0, bt_usb_id = None) -> None:
|
|||||||
mac_history = []
|
mac_history = []
|
||||||
prev_list_snapshot = None
|
prev_list_snapshot = None
|
||||||
while not test_result:
|
while not test_result:
|
||||||
try:
|
# Check if the failed list has been the same for 5 loops
|
||||||
# Check if the failed list has been the same for 5 loops
|
if prev_list_snapshot is not None and passed_list == prev_list_snapshot:
|
||||||
if prev_list_snapshot is not None and passed_list == prev_list_snapshot:
|
# List unchanged - add to mac_history
|
||||||
# List unchanged - add to mac_history
|
mac_history.append(passed_list)
|
||||||
mac_history.append(passed_list)
|
else:
|
||||||
else:
|
# List changed - reset mac_history
|
||||||
# List changed - reset mac_history
|
mac_history = []
|
||||||
mac_history = []
|
mac_history.append(passed_list)
|
||||||
mac_history.append(passed_list)
|
if len(mac_history) == 5 and all(lst == mac_history[0] for lst in mac_history):
|
||||||
if len(mac_history) == 5 and all(lst == mac_history[0] for lst in mac_history):
|
log.warning(f"Last 5 tests have been identical, resetting adapter")
|
||||||
log.warning(f"Last 5 tests have been identical, resetting adapter")
|
reset_adapter()
|
||||||
reset_adapter()
|
mac_history = []
|
||||||
mac_history = []
|
prev_list_snapshot = passed_list
|
||||||
prev_list_snapshot = passed_list
|
|
||||||
except Exception as e:
|
|
||||||
log.error(f"Something went wrong in the history loop - {e}")
|
|
||||||
|
|
||||||
log.info(f" Test run: {test_count} - loop {test_loop_count} start. Initializing run...")
|
log.info(f" Test run: {test_count} - loop {test_loop_count} start. Initializing run...")
|
||||||
test_run_results = sensor_data_query(test_list)
|
test_run_results = sensor_data_query(test_list)
|
||||||
|
|||||||
Reference in new issue
Block a user