diff --git a/src/hardware.cpp b/src/hardware.cpp index 255f043..3395ba8 100644 --- a/src/hardware.cpp +++ b/src/hardware.cpp @@ -9,16 +9,6 @@ void unlockDoor(bool silent) { if (!silent) { granted_beep(); } - #ifdef WIFI - #ifdef WEBHOOKS - #ifdef WEBHOOK_UNLOCK - ExecuteHTTPRequest(String(webhook_unlock_url)); - #endif - #endif - #ifdef TINANCE2_BACKEND - tinance2logrequest("Door Unlocked"); - #endif - #endif #endif #ifdef RELAY1 #ifdef RELAY1_REVERSED @@ -35,6 +25,17 @@ void unlockDoor(bool silent) { digitalWrite(LEDCTL_PIN,LOW); #endif + #ifdef WIFI + #ifdef WEBHOOKS + #ifdef WEBHOOK_UNLOCK + ExecuteHTTPRequest(String(webhook_unlock_url)); + #endif + #endif + + #ifdef TINANCE2_BACKEND + tinance2logrequest("Door Unlocked"); + #endif + #endif } void lockDoor(bool silent) { @@ -42,19 +43,6 @@ void lockDoor(bool silent) { if (!silent) { short_beep(); } - - #ifdef WIFI - #ifdef WEBHOOKS - #ifdef WEBHOOK_LOCK - ExecuteHTTPRequest(String(webhook_lock_url)); - #endif - #endif - - #ifdef TINANCE2_BACKEND - tinance2logrequest("Door Locked"); - #endif - #endif - #endif #ifdef RELAY1 #ifdef RELAY1_REVERSED @@ -70,6 +58,17 @@ void lockDoor(bool silent) { #ifdef LEDCTL_PIN digitalWrite(LEDCTL_PIN,HIGH); #endif + + #ifdef WIFI + #ifdef WEBHOOKS + #ifdef WEBHOOK_LOCK + ExecuteHTTPRequest(String(webhook_lock_url)); + #endif + #endif + #ifdef TINANCE2_BACKEND + tinance2logrequest("Door Locked"); + #endif + #endif }