master^2
Bhaskar 7 months ago
parent 34500f8f2a
commit 8b7c01a704

@ -2952,22 +2952,6 @@ exports.motorAction = async (req, reply) => {
const totalWaterPumped = await calculateTotalPumpedWater(customerId, motorId, start_instance_id); const totalWaterPumped = await calculateTotalPumpedWater(customerId, motorId, start_instance_id);
const lowWaterThreshold = 5; // Adjust as needed
const thresholdTime = new Date(manual_threshold_time); // Convert threshold time
if (new Date() >= thresholdTime || currentWaterPercentage <= lowWaterThreshold) {
console.log("Motor stopping because it entered this condition");
eventEmitter.emit(
"sendThresholdTimeNotification",
customerId,
fcmToken,
manual_threshold_time,
motorId
);
}
console.log("Motor stopped");
eventEmitter.emit("motorStop", customerId, fcmToken, tankName, blockName, stopTime, "Mobile APP", totalWaterPumped, typeOfWater, motorId, eventEmitter.emit("motorStop", customerId, fcmToken, tankName, blockName, stopTime, "Mobile APP", totalWaterPumped, typeOfWater, motorId,
loggedInUser.phone,); loggedInUser.phone,);

Loading…
Cancel
Save