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")