From 1dff4d71b6c70490cd1c9973413ae9e91c98e3c4 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 20 Oct 2026 23:53:56 -0700 Subject: [PATCH] ble - fixing dict in summarize test run --- api/Jenkinsfile.ble_test | 3 ++- api/ble.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/api/Jenkinsfile.ble_test b/api/Jenkinsfile.ble_test index a9b8402..78e8f96 100644 --- a/api/Jenkinsfile.ble_test +++ b/api/Jenkinsfile.ble_test @@ -75,8 +75,9 @@ pipeline { sshagent([env.SSH_CREDENTIALS_ID]) { sh """ ssh -q -o StrictHostKeyChecking=no root@${params.host_ip} -o ServerAliveInterval=60 -o ServerAliveCountMax=120 << EOF - echo Starting BLE test + echo Initiating BLE test in Screen session ble_test_${env.TEST_HASH} sleep 5 + echo Pulling code changes from Gitea... cd /opt/ble-test/ble_api git pull cd /opt/ble-test/ble_api/api diff --git a/api/ble.py b/api/ble.py index 8fa3e40..6c2af47 100644 --- a/api/ble.py +++ b/api/ble.py @@ -337,7 +337,8 @@ 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" {sensors['name']} - Temp: {temp_ctof(sensors['name'])} | Humidity: {sensors['humidity']}") + for sensor in sensors: + log.info(f" {sensor['name']} - Temp: {temp_ctof(sensor['temp'])} | Humidity: {sensor['humidity']}") result = { "found_macs": found_macs, "sensor_results": sensors @@ -362,7 +363,7 @@ def print_sensor_data(sensors): # 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 + return round(f_temp, 1) # This resets the BT adapter when things go caca def reset_adapter():