add temp and humidity from tent, split departures depending on direction

This commit is contained in:
2025-07-30 19:56:19 +02:00
parent ab1d2242c3
commit 09928f0f61
12 changed files with 186 additions and 50 deletions

View File

@@ -0,0 +1,28 @@
import { create } from "zustand";
import { devtools } from "zustand/middleware";
import { fetchTentHumidity, fetchTentTemperature } from "@/api/homeAssistant";
const useHomeAssistantStore = create(
devtools(
(set) => ({
tentTemperature: 0,
tentHumidity: 0,
fetch: async () => {
const [temperature, humidity] = await Promise.all([
fetchTentTemperature(),
fetchTentHumidity(),
]);
set({
tentTemperature: temperature,
tentHumidity: humidity,
});
},
}),
{
name: "home-assistant-store",
},
),
);
export { useHomeAssistantStore };