|
|
|
@ -4828,6 +4828,15 @@ client.on('message', async (topic, message) => {
|
|
|
|
|
const inputConnection = motorTank.connections.inputConnections.find(conn => conn.motor_id === hw_Id); // Updated variable name
|
|
|
|
|
if (inputConnection) {
|
|
|
|
|
inputConnection.motor_status = status; // Update motor status
|
|
|
|
|
if (inputConnection.motor_stop_status === "1" && status === "2" && inputConnection.motor_on_type !== "forced_manual") {
|
|
|
|
|
inputConnection.motor_stop_status = "2";
|
|
|
|
|
inputConnection.motor_on_type = "forced_manual";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (inputConnection.motor_stop_status === "2" && status === "1") {
|
|
|
|
|
inputConnection.motor_stop_status = "1";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await motorTank.save(); // Save the updated tank
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|