0.1.29
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.
|
The format is based on Keep a Changelog and this project uses Semantic Versioning.
|
||||||
|
|
||||||
|
## [0.1.29] - 2026-03-16
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- **BLE Connection**: Implemented a more robust recovery mechanism for `br-connection-not-supported` errors. The add-on will now automatically attempt to run `bluetoothctl remove` to clear the host's device cache before rescanning, which should improve connection reliability on affected systems.
|
||||||
|
|
||||||
## [0.1.28] - 2026-03-16
|
## [0.1.28] - 2026-03-16
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
build_from:
|
build_from:
|
||||||
aarch64: "ghcr.io/home-assistant/aarch64-base:latest"
|
aarch64: "ghcr.io/home-assistant/aarch64-base:latest"
|
||||||
amd64: "ghcr.io/home-assistant/amd64-base:latest"
|
amd64: "ghcr.io/home-assistant/amd64-base:latest"
|
||||||
armhf: "ghcr.io/home-assistant/armhf-base:latest"
|
|
||||||
armv7: "ghcr.io/home-assistant/armv7-base:latest"
|
|
||||||
i386: "ghcr.io/home-assistant/i386-base:latest"
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: "Fichero Printer"
|
name: "Fichero Printer"
|
||||||
version: "0.1.28"
|
version: "0.1.29"
|
||||||
slug: "fichero_printer"
|
slug: "fichero_printer"
|
||||||
description: "REST API for the Fichero D11s (AiYin) thermal label printer over Bluetooth"
|
description: "REST API for the Fichero D11s (AiYin) thermal label printer over Bluetooth"
|
||||||
url: "https://git.leuschner.dev/Tobias/Fichero"
|
url: "https://git.leuschner.dev/Tobias/Fichero"
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ async def lifespan(app: FastAPI): # noqa: ARG001
|
|||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="Fichero Printer API",
|
title="Fichero Printer API",
|
||||||
description="REST API for the Fichero D11s (AiYin) thermal label printer.",
|
description="REST API for the Fichero D11s (AiYin) thermal label printer.",
|
||||||
version="0.1.28",
|
version = "0.1.29",
|
||||||
lifespan=lifespan,
|
lifespan=lifespan,
|
||||||
docs_url=None,
|
docs_url=None,
|
||||||
redoc_url=None,
|
redoc_url=None,
|
||||||
|
|||||||
@@ -487,8 +487,25 @@ async def connect(
|
|||||||
if "br-connection-not-supported" in msg:
|
if "br-connection-not-supported" in msg:
|
||||||
last_exc = exc
|
last_exc = exc
|
||||||
if not forced_rescan_done:
|
if not forced_rescan_done:
|
||||||
|
print(
|
||||||
|
"BLE connection failed with 'br-connection-not-supported'. "
|
||||||
|
"Attempting to clear device cache with 'bluetoothctl remove' and rescan."
|
||||||
|
)
|
||||||
|
# Aggressive recovery: try to remove the device from bluez's cache
|
||||||
|
if address:
|
||||||
|
try:
|
||||||
|
remove_cmd = f'echo -e "remove {address}\\nquit" | bluetoothctl'
|
||||||
|
proc = await asyncio.create_subprocess_shell(
|
||||||
|
remove_cmd,
|
||||||
|
stdout=asyncio.subprocess.DEVNULL,
|
||||||
|
stderr=asyncio.subprocess.DEVNULL,
|
||||||
|
)
|
||||||
|
await asyncio.wait_for(proc.communicate(), timeout=10.0)
|
||||||
|
except Exception as remove_exc:
|
||||||
|
print(f" Failed to run 'bluetoothctl remove': {remove_exc}")
|
||||||
|
|
||||||
forced_rescan_done = True
|
forced_rescan_done = True
|
||||||
target = await resolve_ble_target(None)
|
target = await resolve_ble_target(address)
|
||||||
if attempt < BLE_CONNECT_RETRIES:
|
if attempt < BLE_CONNECT_RETRIES:
|
||||||
await asyncio.sleep(BLE_CONNECT_BACKOFF * attempt)
|
await asyncio.sleep(BLE_CONNECT_BACKOFF * attempt)
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "fichero-printer"
|
name = "fichero-printer"
|
||||||
version = "0.1.28"
|
version = "0.1.29"
|
||||||
description = "Web GUI, Python CLI, and protocol documentation for the Fichero D11s thermal label printer."
|
description = "Web GUI, Python CLI, and protocol documentation for the Fichero D11s thermal label printer."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
|
|||||||
Reference in New Issue
Block a user