Add add-on changelog and improve classic RFCOMM fallback (0.1.9)
This commit is contained in:
@@ -4,6 +4,14 @@ 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.9] - 2026-03-07
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Added add-on-local changelog at `fichero_printer/CHANGELOG.md` so Home Assistant can display release notes in the add-on UI.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Improved Classic Bluetooth connect logic by trying fallback RFCOMM channels (1-3 plus configured channel) before failing.
|
||||||
|
|
||||||
## [0.1.8] - 2026-03-07
|
## [0.1.8] - 2026-03-07
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -384,10 +384,25 @@ async def connect(
|
|||||||
if classic:
|
if classic:
|
||||||
if not address:
|
if not address:
|
||||||
raise PrinterError("--address is required for Classic Bluetooth (no scanning)")
|
raise PrinterError("--address is required for Classic Bluetooth (no scanning)")
|
||||||
async with RFCOMMClient(address, channel) as client:
|
# 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)
|
pc = PrinterClient(client)
|
||||||
await pc.start()
|
await pc.start()
|
||||||
yield pc
|
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:
|
else:
|
||||||
addr = address or await find_printer()
|
addr = address or await find_printer()
|
||||||
try:
|
try:
|
||||||
|
|||||||
32
fichero_printer/CHANGELOG.md
Normal file
32
fichero_printer/CHANGELOG.md
Normal 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.
|
||||||
|
|
||||||
@@ -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) |
|
| `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. |
|
| `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) |
|
| `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
|
## Verwendung
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: "Fichero Printer"
|
name: "Fichero Printer"
|
||||||
version: "0.1.8"
|
version: "0.1.9"
|
||||||
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"
|
||||||
|
|||||||
@@ -384,10 +384,25 @@ async def connect(
|
|||||||
if classic:
|
if classic:
|
||||||
if not address:
|
if not address:
|
||||||
raise PrinterError("--address is required for Classic Bluetooth (no scanning)")
|
raise PrinterError("--address is required for Classic Bluetooth (no scanning)")
|
||||||
async with RFCOMMClient(address, channel) as client:
|
# 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)
|
pc = PrinterClient(client)
|
||||||
await pc.start()
|
await pc.start()
|
||||||
yield pc
|
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:
|
else:
|
||||||
addr = address or await find_printer()
|
addr = address or await find_printer()
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "fichero-printer"
|
name = "fichero-printer"
|
||||||
version = "0.1.8"
|
version = "0.1.9"
|
||||||
description = "Fichero D11s thermal label printer - BLE CLI tool"
|
description = "Fichero D11s thermal label printer - BLE CLI tool"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|||||||
Reference in New Issue
Block a user