Override 'optimistic' for entities in demo mode

This commit is contained in:
Adrian Jagielak
2025-07-24 16:50:04 +02:00
parent d9eca294e3
commit cf6914ed49
2 changed files with 10 additions and 1 deletions

View File

@@ -249,6 +249,15 @@ export function haPublishDevice(parameters: {
Object.assign(handlers, result.commandHandlers);
}
if (demoMode) {
// Apply optimistic override
for (const component of Object.values(components)) {
if ((component as any).optimistic === false) {
(component as any).optimistic = true;
}
}
}
const configTopic = `${topicPrefix}/config`;
const stateTopic = `${topicPrefix}/state`;
const availabilityTopic = `${topicPrefix}/availability`;