diff --git a/api/ble.py b/api/ble.py index 6424f40..54e1e95 100644 --- a/api/ble.py +++ b/api/ble.py @@ -105,7 +105,7 @@ async def _discover_device(mac: str) -> Optional[str]: except Exception as e: log.error(f"Dicvoere call failed - {e}") reset_adapter() - if "AccessDenied" in e: + if "AccessDenied" in str(e): restart_bt_service() return None @@ -165,7 +165,7 @@ async def _scan_once() -> List[str]: except Exception as e: log.error(f"Error reading BLE data - {e}") this_result = None - if "org.freedesktop.DBus.Error.AccessDenied" in e: + if "org.freedesktop.DBus.Error.AccessDenied" in str(e): return [] # only return MACs for devices that pass the _is_match return [dev.address for dev in devices if _is_match(dev.address, dev.name)]