0.1.30
This commit is contained in:
@@ -101,17 +101,13 @@ async def resolve_ble_target(address: str | None = None):
|
||||
device = await BleakScanner.find_device_by_address(address, timeout=8.0)
|
||||
if device is not None:
|
||||
return device
|
||||
# Fallback to active scan/match before giving up; do not fall back to
|
||||
# raw address because BlueZ may then attempt BR/EDR and fail with
|
||||
# br-connection-not-supported.
|
||||
# Fallback to active scan/match before giving up.
|
||||
devices = await BleakScanner.discover(timeout=8)
|
||||
for d in devices:
|
||||
if d.address and d.address.lower() == address.lower():
|
||||
return d
|
||||
raise PrinterNotFound(
|
||||
f"BLE device {address} not found during scan. "
|
||||
"Ensure printer is on, awake, and in range."
|
||||
)
|
||||
print(f" Warning: BLE device {address} not found in scan. Falling back to direct address connection.")
|
||||
return address
|
||||
devices = await BleakScanner.discover(timeout=8)
|
||||
for d in devices:
|
||||
if d.name and any(d.name.startswith(p) for p in PRINTER_NAME_PREFIXES):
|
||||
|
||||
Reference in New Issue
Block a user