From 75542dc962fef033e00ad8ec22a29d456cd935a5 Mon Sep 17 00:00:00 2001 From: matt Date: Sun, 18 Oct 2026 05:28:33 -0700 Subject: [PATCH] ble.py - removing try block from history --- api/ble.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/api/ble.py b/api/ble.py index 57c0390..8f48b04 100644 --- a/api/ble.py +++ b/api/ble.py @@ -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)