Spoolbuddy frontend fixes

This commit is contained in:
maziggy
2026-03-02 11:22:52 +01:00
parent bffbac54e4
commit f2d28a0ef8
17 changed files with 1267 additions and 332 deletions
+18 -1
View File
@@ -67,6 +67,9 @@ class APIClient:
has_scale: bool = True,
tare_offset: int = 0,
calibration_factor: float = 1.0,
nfc_reader_type: str | None = None,
nfc_connection: str | None = None,
has_backlight: bool = False,
) -> dict | None:
while True:
result = await self._post(
@@ -80,6 +83,9 @@ class APIClient:
"has_scale": has_scale,
"tare_offset": tare_offset,
"calibration_factor": calibration_factor,
"nfc_reader_type": nfc_reader_type,
"nfc_connection": nfc_connection,
"has_backlight": has_backlight,
},
)
if result is not None:
@@ -90,7 +96,15 @@ class APIClient:
self._backoff = min(self._backoff * 2, self._max_backoff)
async def heartbeat(
self, device_id: str, nfc_ok: bool, scale_ok: bool, uptime_s: int, ip_address: str | None = None
self,
device_id: str,
nfc_ok: bool,
scale_ok: bool,
uptime_s: int,
ip_address: str | None = None,
firmware_version: str | None = None,
nfc_reader_type: str | None = None,
nfc_connection: str | None = None,
) -> dict | None:
result = await self._post(
f"/devices/{device_id}/heartbeat",
@@ -99,6 +113,9 @@ class APIClient:
"scale_ok": scale_ok,
"uptime_s": uptime_s,
"ip_address": ip_address,
"firmware_version": firmware_version,
"nfc_reader_type": nfc_reader_type,
"nfc_connection": nfc_connection,
},
)
if result and self._buffer: