ble.py - removing try block from history

This commit is contained in:
matt committed 2026-10-18 05:28:33 -07:00
1 parent 725cf29a71
commit 75542dc962
1 file changed
+13 -16
+13 -16
View File
@@ -294,22 +294,19 @@ def test(test_count = 0, bt_usb_id = None) -> None:
mac_history = []
prev_list_snapshot = None
while not test_result:
try:
# 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:
# List unchanged - add to mac_history
mac_history.append(passed_list)
else:
# List changed - reset mac_history
mac_history = []
mac_history.append(passed_list)
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")
reset_adapter()
mac_history = []
prev_list_snapshot = passed_list
except Exception as e:
log.error(f"Something went wrong in the history loop - {e}")
# 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:
# List unchanged - add to mac_history
mac_history.append(passed_list)
else:
# List changed - reset mac_history
mac_history = []
mac_history.append(passed_list)
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")
reset_adapter()
mac_history = []
prev_list_snapshot = passed_list
log.info(f" Test run: {test_count} - loop {test_loop_count} start. Initializing run...")
test_run_results = sensor_data_query(test_list)