From a1e050c688524d0be4bbbfe031cebe8abfeebf0d Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 21 Oct 2026 00:19:16 -0700 Subject: [PATCH] ble - fixing test_driver after cleanup - double result printout gone maybe --- api/ble.py | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/api/ble.py b/api/ble.py index b0e7a6d..ca19d33 100644 --- a/api/ble.py +++ b/api/ble.py @@ -270,10 +270,6 @@ def test_driver(test_count = 0, bt_usb_id = None): # this gets MACs from the comment dict in config for mac in comment_lookup: mac_list.append(mac['mac']) - mac_list = [ - "A4:C1:38:11:F4:2A", - "A4:C1:38:D7:8D:26" - ] log.info("Starting BLE test...") log.info(f" Scanning MACs: {mac_list}") # test_list shrinks with successful tests @@ -323,11 +319,13 @@ def test_driver(test_count = 0, bt_usb_id = None): # If all the MACs have been scanned, then this test is complete. if len(mac_list) == len(passed_list): log.info(f" Test run {test_count} completed, yee-haw") - print("Printing sensor results: ") - print(sensors) print_sensor_data(sensors) test_complete = True - return summarize_test_run(sensors, found_macs) + result = { + "found_macs": found_macs, + "sensor_results": sensors + } + return result # If not, then re-scan the failed sensors else: log.warning(f" Test run incomplete/failed, attempt {len(mac_history)} of {reset_retries}, re-running, loop {test_loop_count}. Updating test list.") @@ -342,19 +340,6 @@ def test_driver(test_count = 0, bt_usb_id = None): # Various other helper functions #################################################### -# helper function for summarizing test run results -def summarize_test_run(sensors, found_macs): - sensor_count = 1 - for sensor in sensors: - print(f"Sensor count: {sensor_count}") - log.info(f" {sensor['name']} - Temp: {temp_ctof(sensor['temp'])} | Humidity: {sensor['humidity']}") - sensor_count = sensor_count + 1 - result = { - "found_macs": found_macs, - "sensor_results": sensors - } - return result - # helper function for processing failed tests def get_failed_macs(mac_list, passed_list): mac_list_new = []