From 0539d6963ebedd554cd3cd36b6c94df9659d6a6b Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Mon, 28 Apr 2025 18:03:28 +0200 Subject: Initial commit Simple frontend version with mock API --- src/helpers/api.ts | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/helpers/api.ts (limited to 'src/helpers/api.ts') 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 { + 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 { + 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, + }, + ]; +} -- cgit v1.3.1