diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c774a2..ed3a719 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ project(nuki_hub CXX) # ARDUHAL_LOG_LEVEL_NONE, define ARDUHAL_LOG_LEVEL_ERROR, define ARDUHAL_LOG_LEVEL_WARN, define ARDUHAL_LOG_LEVEL_INFO, # define ARDUHAL_LOG_LEVEL_DEBUG, define ARDUHAL_LOG_LEVEL_VERBOSE -set(LOG_LEVEL ARDUHAL_LOG_LEVEL_NONE) +set(LOG_LEVEL ARDUHAL_LOG_LEVEL_DEBUG) include_directories(${PROJECT_NAME} PRIVATE diff --git a/WebCfgServer.cpp b/WebCfgServer.cpp index e4e3cd3..ac258e9 100644 --- a/WebCfgServer.cpp +++ b/WebCfgServer.cpp @@ -229,15 +229,28 @@ bool WebCfgServer::processArgs(String& message) { if(value == "#") { - message = "PIN cleared"; + message = "NUKI Lock PIN cleared"; _nuki->setPin(0xffff); } else { - message = "PIN saved"; + message = "NUKI Lock PIN saved"; _nuki->setPin(value.toInt()); } } + else if(key == "NUKIOPPIN" && _nukiOpener != nullptr) + { + if(value == "#") + { + message = "NUKI Opener PIN cleared"; + _nukiOpener->setPin(0xffff); + } + else + { + message = "NUKI Opener PIN saved"; + _nukiOpener->setPin(value.toInt()); + } + } } if(clearMqttCredentials) @@ -364,13 +377,27 @@ void WebCfgServer::buildCredHtml(String &response) response.concat("
"); response.concat(""); - response.concat("

"); - response.concat("

NUKI Pin Code

"); - response.concat(""); - printInputField(response, "NUKIPIN", "PIN Code (# to clear)", "*", 20, true); - response.concat("
"); - response.concat("
"); - response.concat("
"); + if(_nuki != nullptr) + { + response.concat("

"); + response.concat("

NUKI Lock PIN

"); + response.concat(""); + printInputField(response, "NUKIPIN", "PIN Code (# to clear)", "*", 20, true); + response.concat("
"); + response.concat("
"); + response.concat("
"); + } + + if(_nukiOpener != nullptr) + { + response.concat("

"); + response.concat("

NUKI Opener PIN

"); + response.concat(""); + printInputField(response, "NUKIOPPIN", "PIN Code (# to clear)", "*", 20, true); + response.concat("
"); + response.concat("
"); + response.concat("
"); + } _confirmCode = generateConfirmCode(); if(_nuki != nullptr)