From 0062f2fdd1719021ba59777d0da9b584cccf8312 Mon Sep 17 00:00:00 2001 From: varun Date: Wed, 22 May 2024 06:37:00 -0400 Subject: [PATCH] automation of motor switch test2 --- src/controllers/tanksController.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index a6e36335..8929f0dd 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -933,10 +933,10 @@ exports.motorAction = async (req, reply) => { const intervalId = setInterval(async () => { // Check if threshold time has been reached const splr_tank_info3 = await Tank.findOne({ customerId, tankName: req.body.from, tankLocation: req.body.from_type.toLowerCase() }); - const splr_tank_info3_waterlevel = parseInt(supplier_tank_info.waterlevel, 10); - const splr_tank_info3_capacity = parseInt(supplier_tank_info.capacity, 10); + const splr_tank_info3_waterlevel = parseInt(splr_tank_info3.waterlevel, 10); + const splr_tank_info3_capacity = parseInt(splr_tank_info3.capacity, 10); const splr_tank_info3_percentage = (splr_tank_info3_waterlevel / splr_tank_info3_capacity) * 100; - + console.log(splr_tank_info3_percentage,"percentage for less than 20") if (new Date() >= thresholdTime || splr_tank_info3_percentage<=20) { // Stop the motor pump