mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-12-22 10:24:26 +01:00
Improved door responses
This commit is contained in:
parent
ad77fbe86b
commit
5af124000b
@ -69,15 +69,20 @@ void Door::_asyncRead()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (recvBuf == 'U') {
|
if (recvBuf == 'U') {
|
||||||
|
// In case that someone pushed the unlock button - just log it.
|
||||||
|
// No further actions required
|
||||||
_logger(LogLevel::notice, "Someone pushed the unlock button");
|
_logger(LogLevel::notice, "Someone pushed the unlock button");
|
||||||
}
|
goto out;
|
||||||
if (recvBuf == 'L') {
|
} else if (recvBuf == 'L') {
|
||||||
_logger(LogLevel::notice, "Someone pushed the lock button");
|
_logger(LogLevel::notice, "Someone pushed the lock button");
|
||||||
_logger(LogLevel::notice, "Locking...");
|
_logger(LogLevel::notice, "Locking...");
|
||||||
lock();
|
lock();
|
||||||
goto out;
|
goto out;
|
||||||
|
} else if (recvBuf == 'E') {
|
||||||
|
_logger(LogLevel::warning, "Someone did an emergency unlock!");
|
||||||
|
// TODO: Trigger Emergency unlock script
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
// TODO EMERGENCY DOOR BUTTON
|
|
||||||
|
|
||||||
_byteReady = true;
|
_byteReady = true;
|
||||||
_receivedCondition.notify_one();
|
_receivedCondition.notify_one();
|
||||||
|
Loading…
Reference in New Issue
Block a user