diff --git a/src/controllers/installationController.js b/src/controllers/installationController.js index 9947bdf7..61c4609e 100644 --- a/src/controllers/installationController.js +++ b/src/controllers/installationController.js @@ -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 await Insensors.updateOne( { hardwareId: slave.hardwareId }, @@ -1888,6 +1895,7 @@ exports.getMasterSlaveSummary = async (req, reply) => { lora_last_check_time: loraLastCheckTime, lora_last_disconnect_time: loraLastDisconnect, type: slave.type || "slave", + typeOfWater, connected_to: slave.connected_to || null, }); }