From ee56a6e6202e1fa830ddabfe48a20409dca8b93a Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sat, 30 Nov 2024 11:40:47 -0500 Subject: [PATCH] Changed logging to reduce clutter --- src/custom_modules/config.json | 6 ------ src/main.js | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/custom_modules/config.json b/src/custom_modules/config.json index d715e2e..bd815fe 100644 --- a/src/custom_modules/config.json +++ b/src/custom_modules/config.json @@ -50,12 +50,6 @@ "board": 16, "bcm": 23, "mode": "IN" - }, - { - "key": "vacuum", - "board": 22, - "bcm": 25, - "mode": "IN" } ], "power": { diff --git a/src/main.js b/src/main.js index ae3cf37..27954fd 100644 --- a/src/main.js +++ b/src/main.js @@ -32,10 +32,10 @@ setInterval(() => { for (const pin of config.pins) { // If pin is an input, read it if (pin.mode === 'IN') { - fn.log(`Sensor Detection Loop: Reading pin ${pin.board}`, 'DEBUG'); + // fn.log(`Sensor Detection Loop: Reading pin ${pin.board}`, 'DEBUG'); // Read pin gpio.readPin(pin.board).then(state => { - fn.log(`Sensor Detection Loop: Pin ${pin.board} is ${state}`, 'DEBUG'); + // fn.log(`Sensor Detection Loop: Pin ${pin.board} is ${state}`, 'DEBUG'); // Convert the state from string to boolean const boolState = state === '1' ? true : false; // Compare the state to the last known state @@ -44,7 +44,7 @@ setInterval(() => { process.psState[pin.key].on = boolState; // Send the state to the MQTT broker process.comlink.send(config.mqtt.topics[pin.key], JSON.stringify(process.psState[pin.key])); - fn.log(`Sensor Detection Loop: ${pin.key}: ${state}`, 'DEBUG'); + fn.log(`Sensor Detection Loop: State Change: ${pin.key}: ${state} [Old: ${process.psState[pin.key].on}]`, 'DEBUG'); } }).catch(e => fn.log(`Sensor Detection Loop: ${e}`, 'ERROR')); }