Add add-on changelog and improve classic RFCOMM fallback (0.1.9)
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 14:21:36 +01:00
parent 081883c823
commit 54ba6795c0
7 changed files with 81 additions and 11 deletions

View File

@@ -0,0 +1,32 @@
# Changelog
## 0.1.9
- Added add-on local changelog file so Home Assistant can display release notes.
- Improved Classic Bluetooth RFCOMM connection robustness by trying fallback channels (1-3 plus configured channel).
## 0.1.8
- Added Home Assistant web print interface on `/` with status/info/text/image actions.
## 0.1.7
- Fixed ingress Swagger OpenAPI loading behind Home Assistant.
- Enabled `full_access` for stricter hosts blocking RFCOMM sockets.
## 0.1.6
- Added root changelog and release policy.
## 0.1.5
- Added `NET_RAW` capability for Classic Bluetooth sockets.
## 0.1.4
- Fixed RFCOMM connect path under uvloop.
## 0.1.3
- Added ingress/webui metadata updates.

View File

@@ -22,7 +22,7 @@ direkt aus Home Assistant-Automationen, Skripten oder externen Anwendungen.
| `port` | `8765` | Port des REST-API-Servers (auch im „Port-Mapping" oben anpassen) |
| `ble_address` | _(leer)_ | Feste BLE-Adresse des Druckers (z.B. `AA:BB:CC:DD:EE:FF`). Leer lassen für automatischen Scan. |
| `transport` | `ble` | Verbindungsart: `ble` (Bluetooth Low Energy) oder `classic` (RFCOMM) |
| `channel` | `1` | RFCOMM-Kanal nur relevant bei `transport: classic` |
| `channel` | `1` | RFCOMM-Kanal nur relevant bei `transport: classic` (bei Fehlern werden zusätzlich typische Kanäle getestet) |
## Verwendung

View File

@@ -1,5 +1,5 @@
name: "Fichero Printer"
version: "0.1.8"
version: "0.1.9"
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

@@ -384,10 +384,25 @@ async def connect(
if classic:
if not address:
raise PrinterError("--address is required for Classic Bluetooth (no scanning)")
async with RFCOMMClient(address, channel) as client:
pc = PrinterClient(client)
await pc.start()
yield pc
# D11s variants are commonly exposed on channel 1 or 3.
candidates = [channel, 1, 2, 3]
channels = [ch for i, ch in enumerate(candidates) if ch > 0 and ch not in candidates[:i]]
last_exc: Exception | None = None
for ch in channels:
try:
async with RFCOMMClient(address, ch) as client:
pc = PrinterClient(client)
await pc.start()
yield pc
return
except (PrinterError, PrinterTimeout) as exc:
last_exc = exc
if last_exc is not None:
raise PrinterError(
f"Classic Bluetooth connection failed for '{address}'. "
f"Tried channels: {channels}. Last error: {last_exc}"
) from last_exc
raise PrinterError(f"Classic Bluetooth connection failed for '{address}'.")
else:
addr = address or await find_printer()
try: