feat: handleKueFirmwareUpdate

This commit is contained in:
ISA
2025-06-30 15:35:09 +02:00
parent 268ed73cdd
commit 70f842a392
9 changed files with 97 additions and 5 deletions

View File

@@ -0,0 +1,21 @@
// components/main/settingsPageComponents/handlers/handleKueFirmwareUpdate.ts
const handleKueFirmwareUpdate = async () => {
try {
const isDev =
typeof window !== "undefined" && window.location.hostname === "localhost";
const url = isDev
? "/api/cpl/kueFirmwareUpdateMock" // optional, falls du eine Mock-API hast
: "/CPL?Service/ae.ACP&KSU99=1";
const res = await fetch(url);
const result = await res.text();
console.log("Firmwareupdate gesendet:", result);
alert("Firmwareupdate wurde an alle KÜ-Module gesendet.");
} catch (error) {
console.error("Fehler beim Firmwareupdate:", error);
alert("Fehler beim Firmwareupdate.");
}
};
export default handleKueFirmwareUpdate;