2023-02-16 16:12:45 +01:00
|
|
|
import type {
|
|
|
|
BackupDetailModel,
|
|
|
|
AddonData,
|
|
|
|
BackupModel,
|
|
|
|
Folder,
|
|
|
|
} from "@/types/homeAssistant";
|
2023-01-13 16:18:27 +01:00
|
|
|
import kyClient from "./kyClient";
|
|
|
|
|
|
|
|
export function getFolders() {
|
|
|
|
return kyClient.get("homeAssistant/folders").json<Folder[]>();
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getAddons() {
|
|
|
|
return kyClient.get("homeAssistant/addons").json<AddonData>();
|
|
|
|
}
|
2023-02-16 16:12:45 +01:00
|
|
|
|
|
|
|
export function getBackups() {
|
|
|
|
return kyClient.get("homeAssistant/backups").json<BackupModel[]>();
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getBackupDetail(slug: string) {
|
|
|
|
return kyClient.get(`homeAssistant/backup/${slug}`).json<BackupDetailModel>();
|
|
|
|
}
|
2024-07-22 11:20:43 +02:00
|
|
|
|
|
|
|
export function uploadHomeAssistantBackup(slug: string) {
|
|
|
|
return kyClient.post(`homeAssistant/backup/${slug}/upload`);
|
|
|
|
}
|