|
|
|
@ -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") {
|
|
|
|
|