Skip to content

Commit

Permalink
Fix opening door while disconnected
Browse files Browse the repository at this point in the history
Doesn't keep the door open for 10 seconds!
  • Loading branch information
matjack1 committed Apr 23, 2024
1 parent 142dc5b commit c7d2c43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main.cpp
Expand Up @@ -300,7 +300,7 @@ void ICACHE_RAM_ATTR loop()
}

// don't try connecting to WiFi when waiting for pincode
if (doEnableWifi == true && keyTimer == 0)
if (doEnableWifi == true && keyTimer == 0 && activateRelay[0] == true)
{
if (!WiFi.isConnected())
{
Expand Down
6 changes: 3 additions & 3 deletions src/rfid.esp
Expand Up @@ -438,6 +438,9 @@ void rfidProcess()
/*
* Admin user - enable relay (with no time limits) and wifi
*/
#ifdef DEBUG
Serial.println(" has admin access, enable wifi");
#endif
doEnableWifi = true;
processingState = validAdmin;
} else {
Expand Down Expand Up @@ -492,9 +495,6 @@ void rfidOutsideMessaging()
if (processingState == validAdmin)
{
ws.textAll("{\"command\":\"giveAccess\"}");
#ifdef DEBUG
Serial.println(" has admin access, enable wifi");
#endif
if (config.numRelays == 1) {
mqttPublishAccess(epoch, "true", "Admin", username, uid);
} else {
Expand Down

0 comments on commit c7d2c43

Please sign in to comment.