From 9650ca7ed64f9d6445f860cb51bc23dbad454afd Mon Sep 17 00:00:00 2001 From: fbp Date: Tue, 15 Aug 2023 09:28:08 +0200 Subject: [PATCH] Ignore retained messages whn the application start --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c043c0e..06d2e17 100644 --- a/index.js +++ b/index.js @@ -103,7 +103,10 @@ let timer; let alarmStatus = Armed; -mqttClient.on("message", (topic, message) => { +mqttClient.on("message", (topic, message, packet) => { + // console.log(packet); + if (packet.retain) + return; // console.log(topic, message.toString()); switch (topic) { case "motion": {