master^2
Bhaskar 5 months ago
parent b384ced685
commit 5bc4851e3c

@ -1862,7 +1862,14 @@ exports.getMasterSlaveSummary = async (req, reply) => {
} }
} }
} }
const matchedTankDetails = await Tank.findOne({
customerId,
tankhardwareId: slave.tankhardwareId,
}).lean();
if (matchedTankDetails?.typeOfWater) {
typeOfWater = matchedTankDetails.typeOfWater;
}
// Update DB with new status and timestamps // Update DB with new status and timestamps
await Insensors.updateOne( await Insensors.updateOne(
{ hardwareId: slave.hardwareId }, { hardwareId: slave.hardwareId },
@ -1888,6 +1895,7 @@ exports.getMasterSlaveSummary = async (req, reply) => {
lora_last_check_time: loraLastCheckTime, lora_last_check_time: loraLastCheckTime,
lora_last_disconnect_time: loraLastDisconnect, lora_last_disconnect_time: loraLastDisconnect,
type: slave.type || "slave", type: slave.type || "slave",
typeOfWater,
connected_to: slave.connected_to || null, connected_to: slave.connected_to || null,
}); });
} }

Loading…
Cancel
Save