Bhaskar 7 months ago
commit b92fd287ad

@ -2974,7 +2974,10 @@ exports.motorAction = async (req, reply) => {
motorIntervals[motorId] = setInterval(async () => {
console.log(motorId,"interval created")
console.log(customerId,req.body.from,req.body.from_type.toLowerCase())
const supplierTank = await Tank.findOne({ customerId, tankName: req.body.from, tankLocation: req.body.from_type.toLowerCase() });
console.log("up",supplierTank)
console.log(supplierTank.waterlevel,"parseInt(supplierTank.waterlevel, 10)")
const currentWaterLevel = parseInt(supplierTank.waterlevel, 10);
const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100;
const notificationTracker = new Map();

Loading…
Cancel
Save