0.1.35
This commit is contained in:
@@ -5,6 +5,17 @@ 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.35] - 2026-03-18
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- **Web UI**: Fixed "body stream already read" error by reading response body only once.
|
||||||
|
- **Web UI**: Improved response handling to avoid double-reading response stream.
|
||||||
|
- **Web UI**: Better error messages for server-side 500 errors from scan endpoint.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- **Web UI**: Refactored response handling to use single response.read() call.
|
||||||
|
- **Web UI**: Enhanced error display for server-side scan failures.
|
||||||
|
|
||||||
## [0.1.34] - 2026-03-18
|
## [0.1.34] - 2026-03-18
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: "Fichero Printer"
|
name: "Fichero Printer"
|
||||||
version: "0.1.34"
|
version: "0.1.35"
|
||||||
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"
|
||||||
|
|||||||
@@ -77,7 +77,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.34",
|
version = "0.1.35",
|
||||||
lifespan=lifespan,
|
lifespan=lifespan,
|
||||||
docs_url=None,
|
docs_url=None,
|
||||||
redoc_url=None,
|
redoc_url=None,
|
||||||
@@ -155,24 +155,21 @@ def _ui_html() -> str:
|
|||||||
try {
|
try {
|
||||||
const response = await fetch('scan');
|
const response = await fetch('scan');
|
||||||
|
|
||||||
if (!response.ok) {
|
let responseData;
|
||||||
try {
|
try {
|
||||||
const error = await response.json();
|
responseData = await response.json();
|
||||||
throw new Error(error.detail || `HTTP error! status: ${response.status}`);
|
|
||||||
} catch (e) {
|
|
||||||
const text = await response.text();
|
|
||||||
throw new Error(`HTTP error! status: ${response.status}, response: ${text}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let devices;
|
|
||||||
try {
|
|
||||||
devices = await response.json();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const text = await response.text();
|
const text = await response.text();
|
||||||
throw new Error(`Invalid JSON response: ${text}`);
|
throw new Error(`Invalid JSON response: ${text}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
const errorDetail = responseData.detail || `HTTP error! status: ${response.status}`;
|
||||||
|
throw new Error(errorDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
const devices = responseData;
|
||||||
|
|
||||||
if (devices.length === 0) {
|
if (devices.length === 0) {
|
||||||
resultsEl.textContent = '📡 No BLE devices found.\n\nTroubleshooting tips:\n- Make sure your printer is powered on\n- Ensure Bluetooth is enabled on this device\n- Bring the printer closer (within 5 meters)\n- Try restarting the printer';
|
resultsEl.textContent = '📡 No BLE devices found.\n\nTroubleshooting tips:\n- Make sure your printer is powered on\n- Ensure Bluetooth is enabled on this device\n- Bring the printer closer (within 5 meters)\n- Try restarting the printer';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "fichero-printer"
|
name = "fichero-printer"
|
||||||
version = "0.1.34"
|
version = "0.1.35"
|
||||||
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