ble - fixing some coding typos

This commit is contained in:
matt committed 2026-10-20 23:48:09 -07:00
1 parent d3a866329d
commit 90cb977b35
2 files changed
+22 -7

No files matched your search

+10 -5
View File
@@ -282,6 +282,7 @@ def test_driver(test_count = 0, bt_usb_id = None):
####################################################
# here is the big main test loop
# only for second function
# it loops until all MACs in mac_list are found
####################################################
while not test_complete:
@@ -325,7 +326,7 @@ def test_driver(test_count = 0, bt_usb_id = None):
log.warning(f" Test run incomplete/failed, attempt {len(mac_history)} of {reset_retries}, re-running, loop {test_loop_count}. Updating test list.")
print_sensor_data(sensors)
# here is where test_list might shrink
test_list = get_failed_macs(sensors, mac_list, passed_list)
test_list = get_failed_macs(mac_list, passed_list)
log.warning(f" Re-do list - {test_list}")
# end of the big main test loop and test_driver function
@@ -336,7 +337,7 @@ def test_driver(test_count = 0, bt_usb_id = None):
# helper function for summarizing test run results
def summarize_test_run(sensors):
log.info(f" {sensor['name']} - Temp: {round(temp_f,1)} | Humidity: {sensor['humidity']}")
log.info(f" {sensors['name']} - Temp: {temp_ctof(sensors['name'])} | Humidity: {sensors['humidity']}")
result = {
"found_macs": found_macs,
"sensor_results": sensors
@@ -345,7 +346,7 @@ def summarize_test_run(sensors):
return result
# helper function for processing failed tests
def get_failed_macs(sensors, mac_list, passed_list):
def get_failed_macs(mac_list, passed_list):
mac_list_new = []
for mac in mac_list:
if mac not in passed_list:
@@ -356,8 +357,12 @@ def get_failed_macs(sensors, mac_list, passed_list):
def print_sensor_data(sensors):
for sensor in sensors:
# Sorry I can't feel celcius, I want my freedom degrees
temp_f = (sensor['temp'] * 1.80) + 32.0
log.info(f" {sensor['name']} - Temp: {round(temp_f,1)} | Humidity: {sensor['humidity']}")
log.info(f" {sensor['name']} - Temp: {temp_ctof(sensor['temp'])} | Humidity: {sensor['humidity']}")
# yes i am an insufferable american that doesn't think in celcius, sue me
def temp_ctof(c_temp):
f_temp = (c_temp * 1.80) + 32.0
return f_temp
# This resets the BT adapter when things go caca
def reset_adapter():