fix: remove container bluez, use host BlueZ via D-Bus, set DBUS_SYSTEM_BUS_ADDRESS
This commit is contained in:
@@ -1,17 +1,17 @@
|
|||||||
ARG BUILD_FROM
|
ARG BUILD_FROM
|
||||||
FROM $BUILD_FROM
|
FROM $BUILD_FROM
|
||||||
|
|
||||||
# Python 3, BlueZ and pre-compiled Alpine packages (no C compiler needed)
|
# Only dbus-dev needed to talk to the HOST BlueZ via D-Bus (host_dbus: true).
|
||||||
|
# Do NOT install bluez here - we use the host BlueZ, not our own.
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
python3 \
|
python3 \
|
||||||
py3-pip \
|
py3-pip \
|
||||||
py3-numpy \
|
py3-numpy \
|
||||||
py3-pillow \
|
py3-pillow \
|
||||||
bluez \
|
dbus-dev
|
||||||
dbus
|
|
||||||
|
|
||||||
# Pure-Python packages only (no compilation required)
|
# Pure-Python packages (bleak uses dbus-fast internally, no C compiler needed)
|
||||||
RUN pip3 install --no-cache-dir --break-system-packages \
|
RUN pip3 install --no-cache-dir --break-system-packages \
|
||||||
"bleak>=0.21" \
|
"bleak>=0.21" \
|
||||||
"fastapi>=0.111" \
|
"fastapi>=0.111" \
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: "Fichero Printer"
|
name: "Fichero Printer"
|
||||||
version: "0.1.1"
|
version: "0.1.2"
|
||||||
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"
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ set -e
|
|||||||
|
|
||||||
CONFIG_PATH="/data/options.json"
|
CONFIG_PATH="/data/options.json"
|
||||||
|
|
||||||
|
# Use the host BlueZ via D-Bus (requires host_dbus: true in config.yaml)
|
||||||
|
export DBUS_SYSTEM_BUS_ADDRESS="unix:path=/run/dbus/system_bus_socket"
|
||||||
|
|
||||||
# Read add-on options from the HA-provided JSON file using Python (already installed).
|
# Read add-on options from the HA-provided JSON file using Python (already installed).
|
||||||
PORT=$(python3 -c "import json; d=json.load(open('${CONFIG_PATH}')); print(d.get('port', 8765))")
|
PORT=$(python3 -c "import json; d=json.load(open('${CONFIG_PATH}')); print(d.get('port', 8765))")
|
||||||
TRANSPORT=$(python3 -c "import json; d=json.load(open('${CONFIG_PATH}')); print(d.get('transport', 'ble'))")
|
TRANSPORT=$(python3 -c "import json; d=json.load(open('${CONFIG_PATH}')); print(d.get('transport', 'ble'))")
|
||||||
|
|||||||
Reference in New Issue
Block a user