allow to set opener PIN
This commit is contained in:
@@ -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,
|
# 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
|
# 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}
|
include_directories(${PROJECT_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|||||||
@@ -229,15 +229,28 @@ bool WebCfgServer::processArgs(String& message)
|
|||||||
{
|
{
|
||||||
if(value == "#")
|
if(value == "#")
|
||||||
{
|
{
|
||||||
message = "PIN cleared";
|
message = "NUKI Lock PIN cleared";
|
||||||
_nuki->setPin(0xffff);
|
_nuki->setPin(0xffff);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
message = "PIN saved";
|
message = "NUKI Lock PIN saved";
|
||||||
_nuki->setPin(value.toInt());
|
_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)
|
if(clearMqttCredentials)
|
||||||
@@ -364,13 +377,27 @@ void WebCfgServer::buildCredHtml(String &response)
|
|||||||
response.concat("<br><INPUT TYPE=SUBMIT NAME=\"submit\" VALUE=\"Save\">");
|
response.concat("<br><INPUT TYPE=SUBMIT NAME=\"submit\" VALUE=\"Save\">");
|
||||||
response.concat("</FORM>");
|
response.concat("</FORM>");
|
||||||
|
|
||||||
response.concat("<br><br><FORM ACTION=method=get >");
|
if(_nuki != nullptr)
|
||||||
response.concat("<h3>NUKI Pin Code</h3>");
|
{
|
||||||
response.concat("<table>");
|
response.concat("<br><br><FORM ACTION=method=get >");
|
||||||
printInputField(response, "NUKIPIN", "PIN Code (# to clear)", "*", 20, true);
|
response.concat("<h3>NUKI Lock PIN</h3>");
|
||||||
response.concat("</table>");
|
response.concat("<table>");
|
||||||
response.concat("<br><INPUT TYPE=SUBMIT NAME=\"submit\" VALUE=\"Save\">");
|
printInputField(response, "NUKIPIN", "PIN Code (# to clear)", "*", 20, true);
|
||||||
response.concat("</FORM>");
|
response.concat("</table>");
|
||||||
|
response.concat("<br><INPUT TYPE=SUBMIT NAME=\"submit\" VALUE=\"Save\">");
|
||||||
|
response.concat("</FORM>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_nukiOpener != nullptr)
|
||||||
|
{
|
||||||
|
response.concat("<br><br><FORM ACTION=method=get >");
|
||||||
|
response.concat("<h3>NUKI Opener PIN</h3>");
|
||||||
|
response.concat("<table>");
|
||||||
|
printInputField(response, "NUKIOPPIN", "PIN Code (# to clear)", "*", 20, true);
|
||||||
|
response.concat("</table>");
|
||||||
|
response.concat("<br><INPUT TYPE=SUBMIT NAME=\"submit\" VALUE=\"Save\">");
|
||||||
|
response.concat("</FORM>");
|
||||||
|
}
|
||||||
|
|
||||||
_confirmCode = generateConfirmCode();
|
_confirmCode = generateConfirmCode();
|
||||||
if(_nuki != nullptr)
|
if(_nuki != nullptr)
|
||||||
|
|||||||
Reference in New Issue
Block a user