From 886d2971ec175d1d1269fa332212afb877c2962e Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Thu, 9 Jan 2025 16:26:53 +0530 Subject: [PATCH] chnages --- src/controllers/tanksController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 32934939..8aa0519a 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -1571,11 +1571,12 @@ eventEmitter.on('motorStart', async (fcmTokens, timestamp, motorId, waterLevel, // Emit motor stop event with motorId -eventEmitter.on('motorStop', async (fcmTokens, timestamp, motorId, waterLevel, blockName, tankName,stopTime,motorOnType) => { +eventEmitter.on('motorStop', async (fcmTokens, motorId, waterLevel, blockName, tankName, stopTime, motorOnType) => { const message = `MotorId '${motorId}' Water supply from '${blockName}' to '${tankName}' stopped at ${stopTime} by '${motorOnType}' mode. Current Water Level: ${waterLevel} Ltrs.`; await sendNotification(fcmTokens, 'Motor Stopped', message); }); + // Event listener to handle notification eventEmitter.on('sendLowWaterNotification', async (fcmToken, tankInfo) => { const message = formatWaterLevelMessage(tankInfo, 'low');