|
|
|
@ -6003,7 +6003,8 @@ const sendMotorNotifications = async () => {
|
|
|
|
|
const inputConnection = motorTank.connections.inputConnections.find(
|
|
|
|
|
(conn) => conn.motor_id
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const status = inputConnection.motor_status
|
|
|
|
|
console.log("motorTank",inputConnection)
|
|
|
|
|
if (!inputConnection) continue;
|
|
|
|
|
|
|
|
|
|
const { customerId, blockName, tankName } = motorTank;
|
|
|
|
@ -6012,7 +6013,7 @@ const sendMotorNotifications = async () => {
|
|
|
|
|
|
|
|
|
|
// 🔹 Motor Start Condition
|
|
|
|
|
if (
|
|
|
|
|
inputConnection.motor_stop_status === "2" &&
|
|
|
|
|
inputConnection.motor_stop_status === "2" && status ===1 &&
|
|
|
|
|
!motorTank.motor_start_notified
|
|
|
|
|
) {
|
|
|
|
|
console.log("✅ Sending Motor Start Notification...");
|
|
|
|
@ -6067,9 +6068,9 @@ const sendMotorNotifications = async () => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Run the notification check every second
|
|
|
|
|
cron.schedule("* * * * * *", async () => {
|
|
|
|
|
//await sendMotorNotifications();
|
|
|
|
|
});
|
|
|
|
|
// cron.schedule("* * * * * *", async () => {
|
|
|
|
|
// // await sendMotorNotifications();
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|