Fix SpoolBuddy daemon failing to import hardware drivers

The daemon imports read_tag and scale_diag as bare modules, but they
live in spoolbuddy/scripts/ which isn't on sys.path when systemd runs
the daemon. Added scripts/ to sys.path at startup, resolved relative
to the module file. Also moved the read_tag import inside NFCReader's
try/except (was crashing the daemon instead of skipping gracefully)
and demoted hardware-not-available messages from ERROR to INFO.
This commit is contained in:
maziggy
2026-02-27 13:31:51 +01:00
parent 8f3d194596
commit 541f8926b4
4 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ class ScaleReader:
self._ok = True
logger.info("Scale initialized (tare=%d, cal=%.6f)", tare_offset, calibration_factor)
except Exception as e:
logger.error("Scale init failed: %s", e)
logger.info("Scale not available: %s", e)
@property
def ok(self) -> bool: