From a600c9c3b037c00e96ee35e2f6490185e3e1daf4 Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Wed, 5 Mar 2025 14:31:32 +0530 Subject: [PATCH] chnages --- src/controllers/tanksController.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index a7b682c2..a2ee1dec 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -1433,6 +1433,7 @@ eventEmitter.on( const motorName = `${tankName}-${blockName}-${typeOfWater}`; const message = + ` MOTOR STARTED \n` + `🚰 Motor Name: ${motorName}\n` + `🚰 Tank Name: '${tankName}'\n` + `🏢 Block Name: '${blockName}'\n` + @@ -1441,7 +1442,7 @@ eventEmitter.on( `🕒 Pump started at: ${startTime} \n` + `Will stop after: '${manual_threshold_time}' mins`; - await sendNotification(hw_Id, customerId, fcmTokens, "Arminta Water Management", message); + await sendNotification(hw_Id, customerId, fcmTokens, "Arminta", message); } catch (error) { console.error("Error in motorStart event:", error); } @@ -1494,6 +1495,7 @@ eventEmitter.on( const motorName = `${tankName}-${blockName}-${typeOfWater}`; const message = + ` MOTOR STOPPED \n` + `🚰 Motor Name: ${motorName}\n` + `🛢️ Tank Name: '${tankName}'\n` + `🏢 Block Name: '${blockName}'\n` + @@ -1502,7 +1504,7 @@ eventEmitter.on( `🕒 Pump stopped at: ${stopTime}\n` + `💧 Total water pumped: ${totalWaterPumped} liters\n`; - await sendNotification(hw_Id, customerId, fcmTokens, "Arminta Water Management", message); + await sendNotification(hw_Id, customerId, fcmTokens, "Arminta", message); } catch (error) { console.error("Error in motorStop event:", error); } @@ -1582,7 +1584,7 @@ eventEmitter.on('sendCriticalHighWaterNotification', async (fcmTokens, tankInfo, eventEmitter.on('sendThresholdTimeNotification', async (customerId, fcmTokens, thresholdTime, hw_Id) => { try { - const message = `Motor has reached its time threshold of ${thresholdTime} minutes and will stop.`; + const message = `Motor Stopped as it completed ${thresholdTime} minutes.`; await sendNotification(hw_Id, customerId, fcmTokens, 'Motor Alert', message); console.log("Threshold time notification sent successfully."); } catch (error) {