[Feature] Spoolbuddy Fixes and Improvements (#787)

[Feature] Spoolbuddy Fixes and Improvements (#787)
This commit is contained in:
Keybored
2026-03-24 11:56:33 +01:00
committed by GitHub
parent 9f2722be36
commit 6e648804fc
27 changed files with 2276 additions and 326 deletions
+38
View File
@@ -69,6 +69,7 @@ class APIClient:
calibration_factor: float = 1.0,
nfc_reader_type: str | None = None,
nfc_connection: str | None = None,
backend_url: str | None = None,
has_backlight: bool = False,
) -> dict | None:
while True:
@@ -85,6 +86,7 @@ class APIClient:
"calibration_factor": calibration_factor,
"nfc_reader_type": nfc_reader_type,
"nfc_connection": nfc_connection,
"backend_url": backend_url,
"has_backlight": has_backlight,
},
)
@@ -105,6 +107,7 @@ class APIClient:
firmware_version: str | None = None,
nfc_reader_type: str | None = None,
nfc_connection: str | None = None,
backend_url: str | None = None,
) -> dict | None:
result = await self._post(
f"/devices/{device_id}/heartbeat",
@@ -116,6 +119,7 @@ class APIClient:
"firmware_version": firmware_version,
"nfc_reader_type": nfc_reader_type,
"nfc_connection": nfc_connection,
"backend_url": backend_url,
},
)
if result and self._buffer:
@@ -188,3 +192,37 @@ class APIClient:
f"/devices/{device_id}/update-status",
{"status": status, "message": message},
)
async def diagnostic_result(
self,
device_id: str,
diagnostic: str,
success: bool,
output: str,
exit_code: int,
) -> dict | None:
return await self._post(
f"/diagnostics/{device_id}/result",
{
"diagnostic": diagnostic,
"success": success,
"output": output,
"exit_code": exit_code,
},
)
async def system_command_result(
self,
device_id: str,
command: str,
success: bool,
message: str | None = None,
) -> dict | None:
return await self._post(
f"/devices/{device_id}/system/command-result",
{
"command": command,
"success": success,
"message": message,
},
)