master^2
Bhaskar 7 months ago
parent 3dabc53aca
commit c44e781bd3

@ -2952,23 +2952,6 @@ exports.motorAction = async (req, reply) => {
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,
loggedInUser.phone,);

Loading…
Cancel
Save