|
|
@ -991,7 +991,8 @@ exports.motorAction = async (req, reply) => {
|
|
|
|
// Start monitoring water level based on threshold percentage
|
|
|
|
// Start monitoring water level based on threshold percentage
|
|
|
|
const intervalId = setInterval(async () => {
|
|
|
|
const intervalId = setInterval(async () => {
|
|
|
|
// Check if water level has reached the threshold percentage
|
|
|
|
// Check if water level has reached the threshold percentage
|
|
|
|
const current_water_level = parseInt(supplier_tank_info.water_level, 10);
|
|
|
|
const supplier_tank_info1 = await Tank.findOne({ customerId, tankName: req.body.from, tankLocation: req.body.from_type.toLowerCase() });
|
|
|
|
|
|
|
|
const current_water_level = parseInt(supplier_tank_info1.waterlevel, 10);
|
|
|
|
if (current_water_level <= supplier_threshold) {
|
|
|
|
if (current_water_level <= supplier_threshold) {
|
|
|
|
// Stop the motor pump
|
|
|
|
// Stop the motor pump
|
|
|
|
await Tank.updateOne(
|
|
|
|
await Tank.updateOne(
|
|
|
|