Retry BLE service-discovery disconnect errors and bump to 0.1.13
Some checks failed
Deploy to GitHub Pages / build (push) Has been cancelled
Deploy to GitHub Pages / deploy (push) Has been cancelled

This commit is contained in:
paul2212
2026-03-07 15:12:56 +01:00
parent 7778a6f614
commit 42e56e1b9f
6 changed files with 31 additions and 4 deletions

View File

@@ -1,5 +1,9 @@
# Changelog
## 0.1.13
- Marked BLE service-discovery disconnect errors as retryable (`failed to discover services, device disconnected`), so the add-on retries automatically.
## 0.1.12
- Improved BLE connection target resolution by preferring discovered BLE device objects over raw MAC strings to avoid BlueZ `br-connection-not-supported` on some hosts.

View File

@@ -1,5 +1,5 @@
name: "Fichero Printer"
version: "0.1.12"
version: "0.1.13"
slug: "fichero_printer"
description: "REST API for the Fichero D11s (AiYin) thermal label printer over Bluetooth"
url: "https://git.leuschner.dev/Tobias/Fichero"

View File

@@ -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):