Do not periodically poll in demo mode

This commit is contained in:
Adrian Jagielak 2025-07-24 00:36:35 +02:00
parent 0989543a9d
commit de14075234
No known key found for this signature in database
GPG Key ID: 0818CF7AF6C62BFB
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config # https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
name: Futurehome name: Futurehome
version: "0.0.23" version: "0.0.24"
slug: futurehome slug: futurehome
description: Local Futurehome Smarthub integration description: Local Futurehome Smarthub integration
url: "https://github.com/adrianjagielak/home-assistant-futurehome" url: "https://github.com/adrianjagielak/home-assistant-futurehome"

View File

@ -223,7 +223,7 @@ import { delay } from "./utils";
// Request initial state // Request initial state
pollState(); pollState();
// Then poll every 30 seconds // Then poll every 30 seconds
setInterval(pollState, 30000); if (!demoMode) { setInterval(pollState, 30 * 1000); }
const pollDevices = () => { const pollDevices = () => {
log.debug("Refreshing Vinculum devices after 30 minutes..."); 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)); }).catch(e => log.warn("Failed to request state", e));
}; };
// Poll devices every 30 minutes (1800000 ms) // Poll devices every 30 minutes (1800000 ms)
setTimeout(pollDevices, 30 * 60 * 1000); if (!demoMode) { setInterval(pollDevices, 30 * 60 * 1000); }
ha.on('message', (topic, buf) => { ha.on('message', (topic, buf) => {
// Handle Home Assistant command messages // Handle Home Assistant command messages