From 296e8c6ba9f5ff2ce19e17e9c1a1f5f0a972d975 Mon Sep 17 00:00:00 2001 From: Varun Date: Fri, 21 Mar 2025 17:53:15 +0530 Subject: [PATCH] changes --- src/controllers/tanksController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index b8912aed..e7c03d07 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2978,7 +2978,7 @@ exports.motorAction = async (req, reply) => { const currentWaterLevel = parseInt(supplierTank.waterlevel, 10); const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100; const notificationTracker = new Map(); - if (new Date() >= thresholdTime || currentWaterPercentage <= lowWaterThreshold) { + if (new Date() >= motorIntervals[motorId].thresholdTime || currentWaterPercentage <= lowWaterThreshold) { console.log(new Date(),"new date") console.log(thresholdTime,"thresholdTime") console.log("motor stopping because it entered this condition") @@ -3133,7 +3133,7 @@ exports.motorAction = async (req, reply) => { // } }, 30000); // Check every minute - + thresholdTime } else if (req.body.threshold_type === "litres") { console.log("entered litres")