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