|
|
@ -2978,7 +2978,7 @@ exports.motorAction = async (req, reply) => {
|
|
|
|
const currentWaterLevel = parseInt(supplierTank.waterlevel, 10);
|
|
|
|
const currentWaterLevel = parseInt(supplierTank.waterlevel, 10);
|
|
|
|
const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100;
|
|
|
|
const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100;
|
|
|
|
const notificationTracker = new Map();
|
|
|
|
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(new Date(),"new date")
|
|
|
|
console.log(thresholdTime,"thresholdTime")
|
|
|
|
console.log(thresholdTime,"thresholdTime")
|
|
|
|
console.log("motor stopping because it entered this condition")
|
|
|
|
console.log("motor stopping because it entered this condition")
|
|
|
@ -3133,7 +3133,7 @@ exports.motorAction = async (req, reply) => {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
}, 30000); // Check every minute
|
|
|
|
}, 30000); // Check every minute
|
|
|
|
|
|
|
|
thresholdTime
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (req.body.threshold_type === "litres") {
|
|
|
|
else if (req.body.threshold_type === "litres") {
|
|
|
|
console.log("entered litres")
|
|
|
|
console.log("entered litres")
|
|
|
|