From 05b9eaf52c6cc648ec94bd50d0ae34dd13cd8521 Mon Sep 17 00:00:00 2001 From: Matthew Frost Date: Thu, 28 Dec 2023 10:26:16 +0100 Subject: [PATCH] when disabled do not send request --- src/main.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6eaa0be..b75d776 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -611,11 +611,6 @@ void setup() { bool isFirstRun = true; // Declare the missing variable void updateDoorStatus() { - - - bool previousgetDoorDisabled = false; // Declare the missing variable - bool isFirstRun = true; // Declare the missing variable - if (settings.getDoorDisabled() != previousgetDoorDisabled && !isFirstRun) { #ifdef SERIAL_DEBUG @@ -728,7 +723,14 @@ void loop() { #endif #ifdef TINANCE2_BACKEND - tinance2authrequest(String(fullCardID), String(cardID)); + if (settings.getDoorDisabled()) { + #ifdef SERIAL_DEBUG + Serial.println("Door is disabled. Not sending request to Tinance2"); + #endif + } else { + tinance2authrequest(String(fullCardID), String(cardID)); + } + #endif #ifdef LOCAL_ACL