Retry BLE service-discovery disconnect errors and bump to 0.1.13
This commit is contained in:
@@ -426,7 +426,16 @@ async def connect(
|
||||
target = await resolve_ble_target(address)
|
||||
def _is_retryable_ble_error(exc: Exception) -> bool:
|
||||
msg = str(exc).lower()
|
||||
return any(token in msg for token in ("timeout", "timed out", "br-connection-timeout"))
|
||||
return any(
|
||||
token in msg
|
||||
for token in (
|
||||
"timeout",
|
||||
"timed out",
|
||||
"br-connection-timeout",
|
||||
"failed to discover services",
|
||||
"device disconnected",
|
||||
)
|
||||
)
|
||||
|
||||
last_exc: Exception | None = None
|
||||
for attempt in range(1, BLE_CONNECT_RETRIES + 1):
|
||||
|
||||
Reference in New Issue
Block a user