integrated iot

master
Varun 1 year ago
parent 8d07a8e50d
commit 88b272ee4a

@ -2772,6 +2772,7 @@ exports.IotDeviceforstandalone = async (req, reply) => {
// save the document to MongoDB
await ottank.save();
// Delete excess records (keep only the latest three records)
const recordsToKeep = 3;
const recordsToDelete = await IotData.find({ hardwareId })
@ -2825,7 +2826,7 @@ exports.IotDeviceforstandalone = async (req, reply) => {
}
const status = req.body.Motor_status;
console.log(hardwareId)
// Find the tank that contains the specified motor_id in its inputConnections
const tank = await Tank.findOne({ "connections.inputConnections.motor_id": hardwareId });

@ -523,6 +523,7 @@ module.exports = function (fastify, opts, next) {
fastify.get("/api/APIRead", {
schema: {
tags: ["Tank"],

Loading…
Cancel
Save