master^2
Varun 6 months ago
parent 2f55e2dc81
commit 8515b26c37

@ -2975,6 +2975,7 @@ exports.motorAction = async (req, reply) => {
motorIntervals[motorId] = setInterval(async () => { motorIntervals[motorId] = setInterval(async () => {
console.log(motorId,"interval created") console.log(motorId,"interval created")
const supplierTank = await Tank.findOne({ customerId, tankName: req.body.from, tankLocation: req.body.from_type.toLowerCase() }); const supplierTank = await Tank.findOne({ customerId, tankName: req.body.from, tankLocation: req.body.from_type.toLowerCase() });
console.log(parseInt(supplierTank.waterlevel, 10),"parseInt(supplierTank.waterlevel, 10)")
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();

Loading…
Cancel
Save