From b6be226ac2aed31617b3d4c33338d39e14680880 Mon Sep 17 00:00:00 2001 From: Adrian Jagielak Date: Sun, 27 Jul 2025 02:09:51 +0200 Subject: [PATCH] Reset all devices each time when starting in demo mode --- futurehome/CHANGELOG.md | 1 + futurehome/src/index.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/futurehome/CHANGELOG.md b/futurehome/CHANGELOG.md index a23a9af..9d6dbc3 100644 --- a/futurehome/CHANGELOG.md +++ b/futurehome/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.1.7 (26.07.2025) - Added setting for enabling debug log. +- Reset all devices each time when starting in demo mode. ## 0.1.6 (26.07.2025) diff --git a/futurehome/src/index.ts b/futurehome/src/index.ts index 0886970..50199ea 100644 --- a/futurehome/src/index.ts +++ b/futurehome/src/index.ts @@ -92,6 +92,12 @@ import { delay } from './utils'; `^homeassistant/device/futurehome_${hubId}_([a-zA-Z0-9]+)/config$`, ); for (const haDevice of haConfig) { + if (demoMode) { + log.debug('Resetting all devices for demo mode'); + ha?.publish(haDevice.topic, '', { retain: true, qos: 2 }); + continue; + } + log.debug('Found existing HA device', haDevice.topic); const match = haDevice.topic.match(regex);