Retry BLE service-discovery disconnect errors and bump to 0.1.13
This commit is contained in:
@@ -4,6 +4,11 @@ All notable changes to this project are documented in this file.
|
||||
|
||||
The format is based on Keep a Changelog and this project uses Semantic Versioning.
|
||||
|
||||
## [0.1.13] - 2026-03-07
|
||||
|
||||
### Fixed
|
||||
- Treated BLE service-discovery disconnects (`failed to discover services, device disconnected`) as retryable transient errors in the BLE connect loop.
|
||||
|
||||
## [0.1.12] - 2026-03-07
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "fichero-printer"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
description = "Fichero D11s thermal label printer - BLE CLI tool"
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
|
||||
Reference in New Issue
Block a user