diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 5a98008a..17c0947e 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2504,20 +2504,20 @@ exports.motorAction = async (req, reply) => { // delete motorIntervals[motorId]; await checkWaterLevelsAndNotify(customerId, tankName, supplierTank.tankLocation, fcmToken); - if (currentWaterPercentage >= highWaterThreshold && !notificationSentStatus.highWater) { - eventEmitter.emit('sendHighWaterNotification', fcmToken, `Water level has reached high levels.`); - notificationSentStatus.highWater = true; // Set flag to true to prevent duplicate notifications - } + // if (currentWaterPercentage >= highWaterThreshold && !notificationSentStatus.highWater) { + // eventEmitter.emit('sendHighWaterNotification', fcmToken, `Water level has reached high levels.`); + // notificationSentStatus.highWater = true; // Set flag to true to prevent duplicate notifications + // } - if (currentWaterPercentage >= veryHighWaterThreshold && !notificationSentStatus.veryHighWater) { - eventEmitter.emit('sendVeryHighWaterNotification', fcmToken, `Water level has reached very high levels.`); - notificationSentStatus.veryHighWater = true; // Set flag to true to prevent duplicate notifications - } + // if (currentWaterPercentage >= veryHighWaterThreshold && !notificationSentStatus.veryHighWater) { + // eventEmitter.emit('sendVeryHighWaterNotification', fcmToken, `Water level has reached very high levels.`); + // notificationSentStatus.veryHighWater = true; // Set flag to true to prevent duplicate notifications + // } - if (currentWaterPercentage >= criticalHighWaterThreshold && !notificationSentStatus.criticallyHighWater) { - eventEmitter.emit('sendCriticalHighWaterNotification', fcmToken, `Water level has reached critically high levels.`); - notificationSentStatus.criticallyHighWater = true; // Set flag to true to prevent duplicate notifications - } + // if (currentWaterPercentage >= criticalHighWaterThreshold && !notificationSentStatus.criticallyHighWater) { + // eventEmitter.emit('sendCriticalHighWaterNotification', fcmToken, `Water level has reached critically high levels.`); + // notificationSentStatus.criticallyHighWater = true; // Set flag to true to prevent duplicate notifications + // } clearInterval(motorIntervals[motorId]); // Stop the motor if condition met delete motorIntervals[motorId]; // Remove from interval object