From 2b930a6902bd8f1b2a0f78d69cbc513c25e58de8 Mon Sep 17 00:00:00 2001 From: Ollo Date: Thu, 16 Dec 2021 20:24:51 +0100 Subject: [PATCH] Without MQTT no publish --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 991bef8..83bd5e8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -381,14 +381,14 @@ void loopHandler() } /* Clean cycles buttons */ - if (mButtonPressed <= BUTTON_MIN_ACTION_CYCLE) { + if ((!mConnectedNonMQTT) && (mButtonPressed <= BUTTON_MIN_ACTION_CYCLE)) { buttonNode.setProperty(NODE_BUTTON).send("0"); } lastRead = millis(); } /* if the user sees something via the LEDs, inform MQTT, too */ - if (mButtonPressed > BUTTON_MIN_ACTION_CYCLE) { + if ((!mConnectedNonMQTT) && (mButtonPressed > BUTTON_MIN_ACTION_CYCLE)) { buttonNode.setProperty(NODE_BUTTON).send(String(mButtonPressed)); }