Skip to content

Commit

Permalink
Merge branch 'master' of github.com:technyon/nuki_hub
Browse files Browse the repository at this point in the history
  • Loading branch information
technyon committed Jan 30, 2024
2 parents 6c6174f + f64d383 commit bcdcc8a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion AccessLevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ enum class AccessLevel
{
Full = 0,
LockOnly = 1,
ReadOnly = 2
ReadOnly = 2,
LockAndUnlock = 3
};
8 changes: 8 additions & 0 deletions NukiOpenerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,14 @@ LockActionResult NukiOpenerWrapper::onLockActionReceivedCallback(const char *val
nukiOpenerInst->_nextLockAction = action;
return LockActionResult::Success;
break;
case AccessLevel::LockAndUnlock:
if(action == NukiOpener::LockAction::ActivateRTO || action == NukiOpener::LockAction::ActivateCM || action == NukiOpener::LockAction::DeactivateRTO || action == NukiOpener::LockAction::DeactivateCM)
{
nukiOpenerInst->_nextLockAction = action;
return LockActionResult::Success;
}
return LockActionResult::AccessDenied;
break;
case AccessLevel::LockOnly:
if(action == NukiOpener::LockAction::DeactivateRTO || action == NukiOpener::LockAction::DeactivateCM)
{
Expand Down
8 changes: 8 additions & 0 deletions NukiWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,14 @@ LockActionResult NukiWrapper::onLockActionReceivedCallback(const char *value)
nukiInst->_nextLockAction = action;
return LockActionResult::Success;
break;
case AccessLevel::LockAndUnlock:
if(action == NukiLock::LockAction::Lock || action == NukiLock::LockAction::Unlock || action == NukiLock::LockAction::LockNgo || action == NukiLock::LockAction::FullLock)
{
nukiInst->_nextLockAction = action;
return LockActionResult::Success;
}
return LockActionResult::AccessDenied;
break;
case AccessLevel::LockOnly:
if(action == NukiLock::LockAction::Lock)
{
Expand Down
1 change: 1 addition & 0 deletions WebCfgServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ const std::vector<std::pair<String, String>> WebCfgServer::getAccessLevelOptions
std::vector<std::pair<String, String>> options;

options.push_back(std::make_pair(std::to_string((int)AccessLevel::Full).c_str(), "Full"));
options.push_back(std::make_pair(std::to_string((int)AccessLevel::LockAndUnlock).c_str(), "Lock and unlock operation only"));
options.push_back(std::make_pair(std::to_string((int)AccessLevel::LockOnly).c_str(), "Lock operation only"));
options.push_back(std::make_pair(std::to_string((int)AccessLevel::ReadOnly).c_str(), "Read only"));

Expand Down

0 comments on commit bcdcc8a

Please sign in to comment.