summaryrefslogtreecommitdiffstats
path: root/src/helpers
diff options
context:
space:
mode:
authorMaksymilian Jopek <maks@jopek.eu>2025-04-28 18:03:28 +0200
committerMaksymilian Jopek <maks@jopek.eu>2025-04-28 18:03:28 +0200
commit0539d6963ebedd554cd3cd36b6c94df9659d6a6b (patch)
tree9408c7928d0725b114d0adfa811ba2bb3859f495 /src/helpers
downloadrustberry-frontend-0539d6963ebedd554cd3cd36b6c94df9659d6a6b.tar.gz
rustberry-frontend-0539d6963ebedd554cd3cd36b6c94df9659d6a6b.tar.zst
rustberry-frontend-0539d6963ebedd554cd3cd36b6c94df9659d6a6b.zip
Initial commitHEADmaster
Simple frontend version with mock API
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/api.ts103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/helpers/api.ts b/src/helpers/api.ts
new file mode 100644
index 0000000..112ba2f
--- /dev/null
+++ b/src/helpers/api.ts
@@ -0,0 +1,103 @@
+import { type Button } from "@/components/Button";
+import { Timer } from "@/components/Timer";
+
+export async function getButtons(): Promise<Button[]> {
+ return [
+ {
+ type: 0,
+ name: "Brama Wjazdowa",
+ },
+ {
+ type: 0,
+ name: "Brama Toyota",
+ },
+ {
+ type: 0,
+ name: "Brama Passat",
+ },
+ {
+ type: 1,
+ name: "Furtka",
+ },
+ {
+ type: 0,
+ name: "Plafon Maks",
+ },
+ {
+ type: 1,
+ name: "Ciepła woda 52,8°C",
+ },
+ {
+ type: 1,
+ name: "Wentylator łazienka",
+ },
+ {
+ type: 1,
+ name: "Wentylator Kuchnia Dolna",
+ },
+ {
+ type: 1,
+ name: "Pompa źródło",
+ },
+ {
+ type: 1,
+ name: "Nawodnienie",
+ },
+ {
+ type: 1,
+ name: "Choinka+Astro",
+ },
+ {
+ type: 1,
+ name: "Komputer",
+ },
+ {
+ type: 1,
+ name: "Oświetlenie Zewnętrzne",
+ },
+ {
+ type: 1,
+ name: "Blok. czujki ośw. zewn.",
+ },
+ {
+ type: 1,
+ name: "Ogrzewanie 27,5°C",
+ },
+ {
+ type: 1,
+ name: "Termometr - restart",
+ },
+ ];
+}
+
+export async function getTimers(): Promise<Timer[]> {
+ return [
+ {
+ title: "Otwórz bramę wjazową na:",
+ options: [
+ { time: 15, unit: "m" },
+ { time: 45, unit: "m" },
+ { time: 1, unit: "h" },
+ { time: 3, unit: "h" },
+ { time: 24, unit: "h" },
+ { time: 48, unit: "h" },
+ ],
+ backgroundColor: "#ab03ab",
+ onTill: Math.floor(Date.now() / 1000) + 3 * 287721,
+ secondsLeftText: "Otwarte jeszcze przez:",
+ extraStopActions: [{ title: "Zamknij i wyłącz" }],
+ },
+ {
+ title: "Włącz ogrzewanie na:",
+ secondsLeftText: "Włączone jeszcze na:",
+ options: [
+ { time: 1, unit: "h" },
+ { time: 1.5, unit: "h" },
+ { time: 2, unit: "h" },
+ { time: 3, unit: "h" },
+ ],
+ backgroundColor: "#ab03ab",
+ onTill: null,
+ },
+ ];
+}