From 8831ee9e139865461647ef3dd20ae10fc64e1649 Mon Sep 17 00:00:00 2001 From: Clawd Date: Mon, 23 Feb 2026 20:11:51 +0000 Subject: [PATCH] Remove debug log spam from hot path entirely The conditional config.debuglogging checks were not working reliably in node_helper context. Removed debug logging from onStateChangedEvent entirely (it fires on every entity state change - multiple times per second for power sensors). WS disconnect promoted to info level since it's actually useful. --- node_helper.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/node_helper.js b/node_helper.js index be2c0ad..40c82b0 100644 --- a/node_helper.js +++ b/node_helper.js @@ -224,14 +224,8 @@ async function reconnectWebsocket(payload) { } function onStateChangedEvent(event) { - if (config.debuglogging) { - this.logger.debug(`Got state change for ${event.data.entity_id}`); - } for (const connection in this.connections) { if (this.connections[connection].entities.includes(event.data.entity_id)) { - if (config.debuglogging) { - this.logger.debug(`Found listening connection (${connection}) for entity ${event.data.entity_id}`); - } this.sendSocketNotification("CHANGED_STATE", { identifier: connection, cause: event.data.entity_id, @@ -243,9 +237,7 @@ function onStateChangedEvent(event) { function onWebsocketCloseEvent(event) { for (const connection in this.connections) { if (event.target == this.connections[connection].websocket.rawClient.ws) { - if (config.debuglogging) { - this.logger.debug(`Hass WS Disconnected (${connection})`); - } + this.logger.info(`Hass WS Disconnected (${connection})`); this.sendSocketNotification("HASSWS_DISCONNECTED", { identifier: connection, });