added physical motor start to mqtt sub data

master^2
Varun 9 months ago
parent 63e842b9d6
commit 81d6a97e7f

@ -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
}

Loading…
Cancel
Save