diff --git a/src/main.cpp b/src/main.cpp index 98ae0a6..fe6cbcd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -254,7 +254,7 @@ void handleData1Interrupt() { String payload = "{\"full_card_id\":\"" + String(fullCardID) + "\"}"; // Send the HTTP request and get the response Tinance2HttpClient httpClient; - std::pair responsePair = httpClient.sendHttpRequest(tinance2_url_validatecard, "GET", ""); + std::pair responsePair = httpClient.sendHttpRequest(tinance2_url_validatecard, "POST", payload); String response = responsePair.first; int httpResponseCode = responsePair.second; @@ -605,7 +605,10 @@ void setup() { void updateDoorStatus() { - if (settings.DoorDisabled() != previousDoorDisabled || isFirstRun) { + bool previousDoorDisabled = false; // Declare the missing variable + bool isFirstRun = true; // Declare the missing variable + + if (settings.DoorDisabled() != previousDoorDisabled && !isFirstRun) { #ifdef SERIAL_DEBUG Serial.print("DoorDisabled setting changed to: "); @@ -627,11 +630,12 @@ void setup() { #endif lockDoor(); } - - // Update the previousDoorDisabled variable - previousDoorDisabled = settings.DoorDisabled(); - isFirstRun = false; } + + // Update the previousDoorDisabled variable + previousDoorDisabled = settings.DoorDisabled(); + isFirstRun = false; + } #endif