ashok 2 years ago
commit 76935ed058

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

Loading…
Cancel
Save