ble - fixing test_driver after cleanup - short mac list
This commit is contained in:
1 parent
ee78a1965c
commit
e04345e4d9
1 file changed
+7
-1
+7
-1
@@ -270,6 +270,10 @@ def test_driver(test_count = 0, bt_usb_id = None):
|
|||||||
# this gets MACs from the comment dict in config
|
# this gets MACs from the comment dict in config
|
||||||
for mac in comment_lookup:
|
for mac in comment_lookup:
|
||||||
mac_list.append(mac['mac'])
|
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("Starting BLE test...")
|
||||||
log.info(f" Scanning MACs: {mac_list}")
|
log.info(f" Scanning MACs: {mac_list}")
|
||||||
# test_list shrinks with successful tests
|
# test_list shrinks with successful tests
|
||||||
@@ -319,10 +323,10 @@ def test_driver(test_count = 0, bt_usb_id = None):
|
|||||||
# If all the MACs have been scanned, then this test is complete.
|
# If all the MACs have been scanned, then this test is complete.
|
||||||
if len(mac_list) == len(passed_list):
|
if len(mac_list) == len(passed_list):
|
||||||
log.info(f" Test run {test_count} completed, yee-haw")
|
log.info(f" Test run {test_count} completed, yee-haw")
|
||||||
test_complete = True
|
|
||||||
print("Printing sensor results: ")
|
print("Printing sensor results: ")
|
||||||
print(sensors)
|
print(sensors)
|
||||||
print_sensor_data(sensors)
|
print_sensor_data(sensors)
|
||||||
|
test_complete = True
|
||||||
return summarize_test_run(sensors, found_macs)
|
return summarize_test_run(sensors, found_macs)
|
||||||
# If not, then re-scan the failed sensors
|
# If not, then re-scan the failed sensors
|
||||||
else:
|
else:
|
||||||
@@ -340,7 +344,9 @@ def test_driver(test_count = 0, bt_usb_id = None):
|
|||||||
|
|
||||||
# helper function for summarizing test run results
|
# helper function for summarizing test run results
|
||||||
def summarize_test_run(sensors, found_macs):
|
def summarize_test_run(sensors, found_macs):
|
||||||
|
sensor_count = 1
|
||||||
for sensor in sensors:
|
for sensor in sensors:
|
||||||
|
print(f"Sensor count: {sensor_count}")
|
||||||
log.info(f" {sensor['name']} - Temp: {temp_ctof(sensor['temp'])} | Humidity: {sensor['humidity']}")
|
log.info(f" {sensor['name']} - Temp: {temp_ctof(sensor['temp'])} | Humidity: {sensor['humidity']}")
|
||||||
result = {
|
result = {
|
||||||
"found_macs": found_macs,
|
"found_macs": found_macs,
|
||||||
|
|||||||
Reference in new issue
Block a user