add another except to the _discover_device function

This commit is contained in:
matt committed 2026-10-16 22:13:03 -07:00
1 parent ca177ede6c
commit 44eb88ef0a
1 file changed
+3
+3
View File
@@ -78,6 +78,8 @@ async def _discover_device(mac: str) -> Optional[str]:
log.warning("Device %s not found in scan", mac)
except asyncio.TimeoutError:
log.warning("Discover call timed out after %.1fs for %s", SCAN_TIMEOUT + 2.0, mac)
except Exception as e:
log.error(f"Dicvoere call failed - {e}")
return None
def _parse_sensor_data(raw: bytes) -> (float, int):
@@ -223,6 +225,7 @@ def read_data_sync(mac: str) -> Optional[SensorReading]:
def reset_adapter():
log.info("Restting BT Adapter...")
log.info(subprocess.run(["sudo", "rfkill", "block", "bluetooth"], capture_output=True, text=True, check=True).stdout)
time.sleep(2)
log.info(subprocess.run(["sudo", "rfkill", "unblock", "bluetooth"], capture_output=True, text=True, check=True).stdout)
time.sleep(5)
log.info("Reset complete. ")