changes in motoraction

master
Varun 9 months ago
parent 21b6cd5117
commit 44fa88e3dc

@ -3471,13 +3471,16 @@ exports.IotDeviceforstandalonedevice = async (req, reply) => {
message: 'Motor not found for the specified motor_id'
});
}
console.log(hardwareId,"hardwareId")
console.log(status,"status")
// Find the inputConnection with the specified motor_id
const inputConnection = tank.connections.inputConnections.find(conn => conn.motor_id === hardwareId);
if (inputConnection) {
// Update the motor_status of the inputConnection
inputConnection.motor_status = status;
console.log(inputConnection)
// Check if motor_stop_status is "1" and status is "2"
if (inputConnection.motor_stop_status === "1" && status === "2") {

Loading…
Cancel
Save