From de14075234bc2d9043ec265eab14142e00710617 Mon Sep 17 00:00:00 2001 From: Adrian Jagielak Date: Thu, 24 Jul 2025 00:36:35 +0200 Subject: [PATCH] Do not periodically poll in demo mode --- futurehome/config.yaml | 2 +- futurehome/src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/futurehome/config.yaml b/futurehome/config.yaml index a8440cc..05b5eb6 100644 --- a/futurehome/config.yaml +++ b/futurehome/config.yaml @@ -1,6 +1,6 @@ # https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config name: Futurehome -version: "0.0.23" +version: "0.0.24" slug: futurehome description: Local Futurehome Smarthub integration url: "https://github.com/adrianjagielak/home-assistant-futurehome" diff --git a/futurehome/src/index.ts b/futurehome/src/index.ts index ab325f4..0465d67 100644 --- a/futurehome/src/index.ts +++ b/futurehome/src/index.ts @@ -223,7 +223,7 @@ import { delay } from "./utils"; // Request initial state pollState(); // Then poll every 30 seconds - setInterval(pollState, 30000); + if (!demoMode) { setInterval(pollState, 30 * 1000); } const pollDevices = () => { log.debug("Refreshing Vinculum devices after 30 minutes..."); @@ -238,7 +238,7 @@ import { delay } from "./utils"; }).catch(e => log.warn("Failed to request state", e)); }; // Poll devices every 30 minutes (1800000 ms) - setTimeout(pollDevices, 30 * 60 * 1000); + if (!demoMode) { setInterval(pollDevices, 30 * 60 * 1000); } ha.on('message', (topic, buf) => { // Handle Home Assistant command messages