master
varun 1 year ago
parent 9f6a7fd4ae
commit 7ef7b38d58

@ -1235,7 +1235,9 @@ exports.IotDevice = async (req, reply) => {
// Update water level of tanks linked through output connections // Update water level of tanks linked through output connections
for (const outputConnection of existingTank.connections.outputConnections) { for (const outputConnection of existingTank.connections.outputConnections) {
console.log(outputConnection,"this is for testing")
const linkedTank = await Tank.findOne({ hardwareId: outputConnection.outputConnections }); const linkedTank = await Tank.findOne({ hardwareId: outputConnection.outputConnections });
console.log(linkedTank)
if (linkedTank) { if (linkedTank) {
linkedTank.waterlevel = existingTank.waterlevel; linkedTank.waterlevel = existingTank.waterlevel;
await linkedTank.save(); await linkedTank.save();

Loading…
Cancel
Save