From 40ac93a540fefec8950ce9abe85960cf940bf2e2 Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Tue, 25 Feb 2025 17:18:24 +0530 Subject: [PATCH] changes --- src/controllers/tanksController.js | 50 +++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 2f86acf4..d04ba32e 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -6318,21 +6318,21 @@ client.on('message', async (topic, message) => { inputConnection.motor_on_type = "forced_manual"; inputConnection.startTime = currentTime; - // Determine stop criteria dynamically - const stopCriteria = inputConnection.motor_stop_status === "1" ? "manual" : "threshold"; - - eventEmitter.emit( - "sendMotorStartNotification", - customerId, // Pass customerId - fcmTokens, // Pass FCM tokens - hw_Id, // Motor ID - inputConnection.water_level || 0, // Water level - motorTank.blockName || "N/A", // Block name - tankName, // Tank name - inputConnection.motor_on_type, // Motor on type - stopCriteria, // Stop criteria (manual/threshold) - manual_threshold_time // Threshold time (only used for threshold stop) - ); + // // Determine stop criteria dynamically + // const stopCriteria = inputConnection.motor_stop_status === "1" ? "manual" : "threshold"; + + // eventEmitter.emit( + // "sendMotorStartNotification", + // customerId, // Pass customerId + // fcmTokens, // Pass FCM tokens + // hw_Id, // Motor ID + // inputConnection.water_level || 0, // Water level + // motorTank.blockName || "N/A", // Block name + // tankName, // Tank name + // inputConnection.motor_on_type, // Motor on type + // stopCriteria, // Stop criteria (manual/threshold) + // manual_threshold_time // Threshold time (only used for threshold stop) + // ); } @@ -6341,16 +6341,16 @@ client.on('message', async (topic, message) => { inputConnection.motor_stop_status = "1"; inputConnection.stopTime = currentTime; - eventEmitter.emit( - "sendMotorStopNotification", - customerId, // Pass customerId - fcmTokens, // Pass FCM tokens - hw_Id, // Motor ID - inputConnection.water_level || 0, - motorTank.blockName || "N/A", - tankName, - inputConnection.motor_on_type - ); + // eventEmitter.emit( + // "sendMotorStopNotification", + // customerId, // Pass customerId + // fcmTokens, // Pass FCM tokens + // hw_Id, // Motor ID + // inputConnection.water_level || 0, + // motorTank.blockName || "N/A", + // tankName, + // inputConnection.motor_on_type + // ); } await motorTank.save();