door controller

This commit is contained in:
Matthew Frost 2023-10-30 19:33:24 +01:00
parent cc5c44c8e2
commit 752cdf3194

View file

@ -12,22 +12,23 @@ void commandLockDoor() {
; ;
if (!settings.DoorDisabled()) { if (!settings.DoorDisabled()) {
lockDoor(); lockDoor();
Serial.println("DOOR_LOCK_STATUS=" + stateDoor() );
} else { } else {
Serial.println("LOG_MSG=Door Disabled Ignoring Command"); Serial.println("LOG_MSG=Door Disabled Ignoring Command");
} }
Serial.println("DOOR_LOCK_STATUS=" + stateDoor() );
} }
void commandUnlockDoor() { void commandUnlockDoor() {
// Add code to unlock the door here (e.g., deactivate a relay, if applicable) // Add code to unlock the door here (e.g., deactivate a relay, if applicable)
if (!settings.DoorDisabled()) { if (!settings.DoorDisabled()) {
unlockDoor(false); unlockDoor(false);
Serial.println("DOOR_LOCK_STATUS=" + stateDoor());
delay(RELAY_DELAY); delay(RELAY_DELAY);
lockDoor(); lockDoor();
Serial.println("DOOR_LOCK_STATUS=" + stateDoor());
} else { } else {
Serial.println("LOG_MSG=Door Disabled Ignoring Command"); Serial.println("LOG_MSG=Door Disabled Ignoring Command");
} }
Serial.println("DOOR_LOCK_STATUS=" + stateDoor());
} }
void commandToggleDoor() { void commandToggleDoor() {
@ -35,15 +36,13 @@ void commandToggleDoor() {
; ;
if (!settings.DoorDisabled()) { if (!settings.DoorDisabled()) {
toggleDoor(); toggleDoor();
delay(RELAY_DELAY); Serial.println("DOOR_LOCK_STATUS=" + stateDoor() );
} else { } else {
Serial.println("LOG_MSG=Door Disabled Ignoring Command"); Serial.println("LOG_MSG=Door Disabled Ignoring Command");
} }
Serial.println("DOOR_LOCK_STATUS=" + stateDoor() );
} }
void commandLockStateDoor() { void commandLockStateDoor() {
// Add code to get door state // Add code to get door state
Serial.println("DOOR_LOCK_STATUS=" + stateDoor()); Serial.println("DOOR_LOCK_STATUS=" + stateDoor());