ble - fixing dict in summarize test run
This commit is contained in:
1 parent
90cb977b35
commit
1dff4d71b6
2 files changed
+5
-3
No files matched your search
@@ -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
|
||||
|
||||
+3
-2
@@ -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():
|
||||
|
||||
Reference in new issue
Block a user