bug payload

This commit is contained in:
Matthew Frost 2023-12-27 22:13:47 +01:00
parent 8e196676ea
commit f9a6c4fec2

View file

@ -254,7 +254,7 @@ void handleData1Interrupt() {
String payload = "{\"full_card_id\":\"" + String(fullCardID) + "\"}"; String payload = "{\"full_card_id\":\"" + String(fullCardID) + "\"}";
// Send the HTTP request and get the response // Send the HTTP request and get the response
Tinance2HttpClient httpClient; Tinance2HttpClient httpClient;
std::pair<String, int> responsePair = httpClient.sendHttpRequest(tinance2_url_validatecard, "GET", ""); std::pair<String, int> responsePair = httpClient.sendHttpRequest(tinance2_url_validatecard, "POST", payload);
String response = responsePair.first; String response = responsePair.first;
int httpResponseCode = responsePair.second; int httpResponseCode = responsePair.second;
@ -605,7 +605,10 @@ void setup() {
void updateDoorStatus() { 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 #ifdef SERIAL_DEBUG
Serial.print("DoorDisabled setting changed to: "); Serial.print("DoorDisabled setting changed to: ");
@ -627,11 +630,12 @@ void setup() {
#endif #endif
lockDoor(); lockDoor();
} }
// Update the previousDoorDisabled variable
previousDoorDisabled = settings.DoorDisabled();
isFirstRun = false;
} }
// Update the previousDoorDisabled variable
previousDoorDisabled = settings.DoorDisabled();
isFirstRun = false;
} }
#endif #endif