|
|
@ -2127,6 +2127,11 @@ else if (currentWaterLevel >= highWaterThreshold) {
|
|
|
|
const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100;
|
|
|
|
const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100;
|
|
|
|
|
|
|
|
|
|
|
|
if (new Date() >= thresholdTime || currentWaterPercentage <= lowWaterThreshold) {
|
|
|
|
if (new Date() >= thresholdTime || currentWaterPercentage <= lowWaterThreshold) {
|
|
|
|
|
|
|
|
console.log(thresholdTime,"thresholdtime")
|
|
|
|
|
|
|
|
console.log(new Date(),"new time")
|
|
|
|
|
|
|
|
console.log(currentWaterPercentage,"currentWaterPercentage")
|
|
|
|
|
|
|
|
console.log(lowWaterThreshold,"lowWaterThreshold")
|
|
|
|
|
|
|
|
|
|
|
|
console.log("motor stopping because it entered this condition")
|
|
|
|
console.log("motor stopping because it entered this condition")
|
|
|
|
await Tank.updateOne(
|
|
|
|
await Tank.updateOne(
|
|
|
|
{ customerId, "connections.inputConnections.motor_id": motorId },
|
|
|
|
{ customerId, "connections.inputConnections.motor_id": motorId },
|
|
|
|