mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 21:47:39 +02:00
Spoolbuddy frontend fixes
This commit is contained in:
@@ -4864,6 +4864,12 @@ export interface SpoolBuddyDevice {
|
||||
has_scale: boolean;
|
||||
tare_offset: number;
|
||||
calibration_factor: number;
|
||||
nfc_reader_type: string | null;
|
||||
nfc_connection: string | null;
|
||||
display_brightness: number;
|
||||
display_blank_timeout: number;
|
||||
has_backlight: boolean;
|
||||
last_calibrated_at: string | null;
|
||||
last_seen: string | null;
|
||||
pending_command: string | null;
|
||||
nfc_ok: boolean;
|
||||
@@ -4872,6 +4878,13 @@ export interface SpoolBuddyDevice {
|
||||
online: boolean;
|
||||
}
|
||||
|
||||
export interface DaemonUpdateCheck {
|
||||
current_version: string;
|
||||
latest_version: string | null;
|
||||
update_available: boolean;
|
||||
release_url: string | null;
|
||||
}
|
||||
|
||||
// SpoolBuddy API
|
||||
export const spoolbuddyApi = {
|
||||
getDevices: () =>
|
||||
@@ -4897,4 +4910,13 @@ export const spoolbuddyApi = {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ spool_id: spoolId, weight_grams: weightGrams }),
|
||||
}),
|
||||
|
||||
updateDisplay: (deviceId: string, brightness: number, blankTimeout: number) =>
|
||||
request<{ status: string }>(`/spoolbuddy/devices/${deviceId}/display`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ brightness, blank_timeout: blankTimeout }),
|
||||
}),
|
||||
|
||||
checkDaemonUpdate: (deviceId: string, includeBeta?: boolean) =>
|
||||
request<DaemonUpdateCheck>(`/spoolbuddy/devices/${deviceId}/update-check?include_beta=${includeBeta ?? false}`),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user