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
2 changed files with 3 additions and 3 deletions

View File

@@ -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