From 1322f2f139928f6207dfc5f11d1087e8d9ef527a Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 13 Oct 2026 06:33:27 -0700 Subject: [PATCH] add try block in ble.py when reading data --- ble.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ble.py b/ble.py index 8c8e50d..bea7f80 100644 --- a/ble.py +++ b/ble.py @@ -74,7 +74,10 @@ async def read_data(mac_address): def sensor_data_query(mac_list): result = [] for mac in mac_list: - this_result = asyncio.run(read_data(mac)) + try: + this_result = asyncio.run(read_data(mac)) + except Exception as e: + print(f"Error reading BLE data - {e}") result.append({"name": mac, "temp": this_result[0], "humidity": this_result[1]}) print(f"Data query complete - returning result") return result