Merge branch 'master' into update-wifimanager
This commit is contained in:
@@ -263,6 +263,10 @@ bool WebCfgServer::processArgs(String& message)
|
||||
bool clearMqttCredentials = false;
|
||||
bool clearCredentials = false;
|
||||
uint32_t aclPrefs[17] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
uint32_t basicLockConfigAclPrefs[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
uint32_t basicOpenerConfigAclPrefs[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
uint32_t advancedLockConfigAclPrefs[22] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
uint32_t advancedOpenerConfigAclPrefs[20] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
int count = _server.args();
|
||||
|
||||
@@ -470,11 +474,6 @@ bool WebCfgServer::processArgs(String& message)
|
||||
{
|
||||
aclLvlChanged = true;
|
||||
}
|
||||
else if(key == "ACLCNF")
|
||||
{
|
||||
_preferences->putBool(preference_admin_enabled, (value == "1"));
|
||||
configChanged = true;
|
||||
}
|
||||
else if(key == "KPPUB")
|
||||
{
|
||||
_preferences->putBool(preference_keypad_info_enabled, (value == "1"));
|
||||
@@ -568,6 +567,294 @@ bool WebCfgServer::processArgs(String& message)
|
||||
{
|
||||
aclPrefs[16] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKNAME")
|
||||
{
|
||||
basicLockConfigAclPrefs[0] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKLAT")
|
||||
{
|
||||
basicLockConfigAclPrefs[1] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKLONG")
|
||||
{
|
||||
basicLockConfigAclPrefs[2] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKAUNL")
|
||||
{
|
||||
basicLockConfigAclPrefs[3] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKPRENA")
|
||||
{
|
||||
basicLockConfigAclPrefs[4] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKBTENA")
|
||||
{
|
||||
basicLockConfigAclPrefs[5] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKLEDENA")
|
||||
{
|
||||
basicLockConfigAclPrefs[6] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKLEDBR")
|
||||
{
|
||||
basicLockConfigAclPrefs[7] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKTZOFF")
|
||||
{
|
||||
basicLockConfigAclPrefs[8] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKDSTM")
|
||||
{
|
||||
basicLockConfigAclPrefs[9] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKFOB1")
|
||||
{
|
||||
basicLockConfigAclPrefs[10] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKFOB2")
|
||||
{
|
||||
basicLockConfigAclPrefs[11] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKFOB3")
|
||||
{
|
||||
basicLockConfigAclPrefs[12] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKSGLLCK")
|
||||
{
|
||||
basicLockConfigAclPrefs[13] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKADVM")
|
||||
{
|
||||
basicLockConfigAclPrefs[14] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKTZID")
|
||||
{
|
||||
basicLockConfigAclPrefs[15] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKUPOD")
|
||||
{
|
||||
advancedLockConfigAclPrefs[0] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKLPOD")
|
||||
{
|
||||
advancedLockConfigAclPrefs[1] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKSLPOD")
|
||||
{
|
||||
advancedLockConfigAclPrefs[2] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKUTLTOD")
|
||||
{
|
||||
advancedLockConfigAclPrefs[3] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKLNGT")
|
||||
{
|
||||
advancedLockConfigAclPrefs[4] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKSBPA")
|
||||
{
|
||||
advancedLockConfigAclPrefs[5] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKDBPA")
|
||||
{
|
||||
advancedLockConfigAclPrefs[6] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKDC")
|
||||
{
|
||||
advancedLockConfigAclPrefs[7] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKBATT")
|
||||
{
|
||||
advancedLockConfigAclPrefs[8] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKABTD")
|
||||
{
|
||||
advancedLockConfigAclPrefs[9] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKUNLD")
|
||||
{
|
||||
advancedLockConfigAclPrefs[10] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKALT")
|
||||
{
|
||||
advancedLockConfigAclPrefs[11] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKAUNLD")
|
||||
{
|
||||
advancedLockConfigAclPrefs[12] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKNMENA")
|
||||
{
|
||||
advancedLockConfigAclPrefs[13] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKNMST")
|
||||
{
|
||||
advancedLockConfigAclPrefs[14] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKNMET")
|
||||
{
|
||||
advancedLockConfigAclPrefs[15] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKNMALENA")
|
||||
{
|
||||
advancedLockConfigAclPrefs[16] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKNMAULD")
|
||||
{
|
||||
advancedLockConfigAclPrefs[17] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKNMLOS")
|
||||
{
|
||||
advancedLockConfigAclPrefs[18] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKALENA")
|
||||
{
|
||||
advancedLockConfigAclPrefs[19] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKIALENA")
|
||||
{
|
||||
advancedLockConfigAclPrefs[20] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFLCKAUENA")
|
||||
{
|
||||
advancedLockConfigAclPrefs[21] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNNAME")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[0] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNLAT")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[1] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNLONG")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[2] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNPRENA")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[3] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNBTENA")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[4] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNLEDENA")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[5] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNTZOFF")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[6] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNDSTM")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[7] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNFOB1")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[8] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNFOB2")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[9] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNFOB3")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[10] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNOPM")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[11] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNADVM")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[12] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNTZID")
|
||||
{
|
||||
basicOpenerConfigAclPrefs[13] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNICID")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[0] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNBUSMS")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[1] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNSCDUR")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[2] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNESD")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[3] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNRESD")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[4] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNESDUR")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[5] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNDRTOAR")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[6] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNRTOT")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[7] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNDRBSUP")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[8] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNDRBSUPDUR")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[9] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNSRING")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[10] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNSOPN")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[11] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNSRTO")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[12] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNSCM")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[13] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNSCFRM")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[14] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNSLVL")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[15] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNSBPA")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[16] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNDBPA")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[17] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNBATT")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[18] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "CONFOPNABTD")
|
||||
{
|
||||
advancedOpenerConfigAclPrefs[19] = ((value == "1") ? 1 : 0);
|
||||
}
|
||||
else if(key == "REGAPP")
|
||||
{
|
||||
_preferences->putBool(preference_register_as_app, (value == "1"));
|
||||
@@ -654,6 +941,10 @@ bool WebCfgServer::processArgs(String& message)
|
||||
if(aclLvlChanged)
|
||||
{
|
||||
_preferences->putBytes(preference_acl, (byte*)(&aclPrefs), sizeof(aclPrefs));
|
||||
_preferences->putBytes(preference_conf_lock_basic_acl, (byte*)(&basicLockConfigAclPrefs), sizeof(basicLockConfigAclPrefs));
|
||||
_preferences->putBytes(preference_conf_opener_basic_acl, (byte*)(&basicOpenerConfigAclPrefs), sizeof(basicOpenerConfigAclPrefs));
|
||||
_preferences->putBytes(preference_conf_lock_advanced_acl, (byte*)(&advancedLockConfigAclPrefs), sizeof(advancedLockConfigAclPrefs));
|
||||
_preferences->putBytes(preference_conf_opener_advanced_acl, (byte*)(&advancedOpenerConfigAclPrefs), sizeof(advancedOpenerConfigAclPrefs));
|
||||
configChanged = true;
|
||||
}
|
||||
|
||||
@@ -782,12 +1073,7 @@ void WebCfgServer::buildHtml(String& response)
|
||||
|
||||
printParameter(response, "Firmware", version.c_str(), "/info");
|
||||
|
||||
if(_preferences->getBool(preference_check_updates))
|
||||
{
|
||||
//if(atof(_latestVersion) > atof(NUKI_HUB_VERSION) || (atof(_latestVersion) == atof(NUKI_HUB_VERSION) && _latestVersion != NUKI_HUB_VERSION)) {
|
||||
printParameter(response, "Latest Firmware", _preferences->getString(preference_latest_version).c_str(), "/ota");
|
||||
//}
|
||||
}
|
||||
if(_preferences->getBool(preference_check_updates)) printParameter(response, "Latest Firmware", _preferences->getString(preference_latest_version).c_str(), "/ota");
|
||||
|
||||
response.concat("</table><br><table id=\"tblnav\"><tbody>");
|
||||
response.concat("<tr><td><h3>MQTT and Network Configuration</h3></td><td class=\"tdbtn\">");
|
||||
@@ -954,24 +1240,24 @@ void WebCfgServer::buildMqttConfigHtml(String &response)
|
||||
response.concat("<table>");
|
||||
printInputField(response, "HASSDISCOVERY", "Home Assistant discovery topic (empty to disable; usually homeassistant)", _preferences->getString(preference_mqtt_hass_discovery).c_str(), 30);
|
||||
printInputField(response, "HASSCUURL", "Home Assistant device configuration URL (empty to use http://LOCALIP; fill when using a reverse proxy for example)", _preferences->getString(preference_mqtt_hass_cu_url).c_str(), 261);
|
||||
if(_nukiOpener != nullptr) printCheckBox(response, "OPENERCONT", "Set Nuki Opener Lock/Unlock action in Home Assistant to Continuous mode", _preferences->getBool(preference_opener_continuous_mode));
|
||||
if(_nukiOpener != nullptr) printCheckBox(response, "OPENERCONT", "Set Nuki Opener Lock/Unlock action in Home Assistant to Continuous mode", _preferences->getBool(preference_opener_continuous_mode), "");
|
||||
printTextarea(response, "MQTTCA", "MQTT SSL CA Certificate (*, optional)", _preferences->getString(preference_mqtt_ca).c_str(), TLS_CA_MAX_SIZE, _network->encryptionSupported(), true);
|
||||
printTextarea(response, "MQTTCRT", "MQTT SSL Client Certificate (*, optional)", _preferences->getString(preference_mqtt_crt).c_str(), TLS_CERT_MAX_SIZE, _network->encryptionSupported(), true);
|
||||
printTextarea(response, "MQTTKEY", "MQTT SSL Client Key (*, optional)", _preferences->getString(preference_mqtt_key).c_str(), TLS_KEY_MAX_SIZE, _network->encryptionSupported(), true);
|
||||
printDropDown(response, "NWHW", "Network hardware", String(_preferences->getInt(preference_network_hardware)), getNetworkDetectionOptions());
|
||||
printCheckBox(response, "NWHWWIFIFB", "Disable fallback to Wi-Fi / Wi-Fi config portal", _preferences->getBool(preference_network_wifi_fallback_disabled));
|
||||
printCheckBox(response, "BESTRSSI", "Connect to AP with the best signal in an environment with multiple APs with the same SSID", _preferences->getBool(preference_find_best_rssi));
|
||||
printCheckBox(response, "NWHWWIFIFB", "Disable fallback to Wi-Fi / Wi-Fi config portal", _preferences->getBool(preference_network_wifi_fallback_disabled), "");
|
||||
printCheckBox(response, "BESTRSSI", "Connect to AP with the best signal in an environment with multiple APs with the same SSID", _preferences->getBool(preference_find_best_rssi), "");
|
||||
printInputField(response, "RSSI", "RSSI Publish interval (seconds; -1 to disable)", _preferences->getInt(preference_rssi_publish_interval), 6);
|
||||
printInputField(response, "NETTIMEOUT", "Network Timeout until restart (seconds; -1 to disable)", _preferences->getInt(preference_network_timeout), 5);
|
||||
printCheckBox(response, "RSTDISC", "Restart on disconnect", _preferences->getBool(preference_restart_on_disconnect));
|
||||
printCheckBox(response, "MQTTLOG", "Enable MQTT logging", _preferences->getBool(preference_mqtt_log_enabled));
|
||||
printCheckBox(response, "CHECKUPDATE", "Check for Firmware Updates every 24h", _preferences->getBool(preference_check_updates));
|
||||
printCheckBox(response, "RSTDISC", "Restart on disconnect", _preferences->getBool(preference_restart_on_disconnect), "");
|
||||
printCheckBox(response, "MQTTLOG", "Enable MQTT logging", _preferences->getBool(preference_mqtt_log_enabled), "");
|
||||
printCheckBox(response, "CHECKUPDATE", "Check for Firmware Updates every 24h", _preferences->getBool(preference_check_updates), "");
|
||||
response.concat("</table>");
|
||||
response.concat("* If no encryption is configured for the MQTT broker, leave empty. Only supported for Wi-Fi connections.<br><br>");
|
||||
|
||||
response.concat("<h3>IP Address assignment</h3>");
|
||||
response.concat("<table>");
|
||||
printCheckBox(response, "DHCPENA", "Enable DHCP", _preferences->getBool(preference_ip_dhcp_enabled));
|
||||
printCheckBox(response, "DHCPENA", "Enable DHCP", _preferences->getBool(preference_ip_dhcp_enabled), "");
|
||||
printInputField(response, "IPADDR", "Static IP address", _preferences->getString(preference_ip_address).c_str(), 15);
|
||||
printInputField(response, "IPSUB", "Subnet", _preferences->getString(preference_ip_subnet).c_str(), 15);
|
||||
printInputField(response, "IPGTW", "Default gateway", _preferences->getString(preference_ip_gateway).c_str(), 15);
|
||||
@@ -993,46 +1279,155 @@ void WebCfgServer::buildAccLvlHtml(String &response)
|
||||
response.concat("<input type=\"hidden\" name=\"ACLLVLCHANGED\" value=\"1\">");
|
||||
response.concat("<h3>Nuki General Access Control</h3>");
|
||||
response.concat("<table><tr><th>Setting</th><th>Enabled</th></tr>");
|
||||
printCheckBox(response, "ACLCNF", "Change Nuki configuration", _preferences->getBool(preference_admin_enabled));
|
||||
|
||||
if((_nuki != nullptr && _nuki->hasKeypad()) || (_nukiOpener != nullptr && _nukiOpener->hasKeypad()))
|
||||
{
|
||||
printCheckBox(response, "KPPUB", "Publish keypad codes information", _preferences->getBool(preference_keypad_info_enabled));
|
||||
printCheckBox(response, "KPENA", "Add, modify and delete keypad codes", _preferences->getBool(preference_keypad_control_enabled));
|
||||
printCheckBox(response, "KPPUB", "Publish keypad codes information", _preferences->getBool(preference_keypad_info_enabled), "");
|
||||
printCheckBox(response, "KPENA", "Add, modify and delete keypad codes", _preferences->getBool(preference_keypad_control_enabled), "");
|
||||
}
|
||||
|
||||
printCheckBox(response, "TCPUB", "Publish time control entries information", _preferences->getBool(preference_timecontrol_info_enabled));
|
||||
printCheckBox(response, "TCENA", "Add, modify and delete time control entries", _preferences->getBool(preference_timecontrol_control_enabled));
|
||||
printCheckBox(response, "PUBAUTH", "Publish authorisation log (may reduce battery life)", _preferences->getBool(preference_publish_authdata));
|
||||
printCheckBox(response, "TCPUB", "Publish time control entries information", _preferences->getBool(preference_timecontrol_info_enabled), "");
|
||||
printCheckBox(response, "TCENA", "Add, modify and delete time control entries", _preferences->getBool(preference_timecontrol_control_enabled), "");
|
||||
printCheckBox(response, "PUBAUTH", "Publish authorisation log (may reduce battery life)", _preferences->getBool(preference_publish_authdata), "");
|
||||
response.concat("</table><br>");
|
||||
if(_nuki != nullptr)
|
||||
{
|
||||
uint32_t basicLockConfigAclPrefs[16];
|
||||
_preferences->getBytes(preference_conf_lock_basic_acl, &basicLockConfigAclPrefs, sizeof(basicLockConfigAclPrefs));
|
||||
uint32_t advancedLockConfigAclPrefs[22];
|
||||
_preferences->getBytes(preference_conf_lock_advanced_acl, &advancedLockConfigAclPrefs, sizeof(advancedLockConfigAclPrefs));
|
||||
|
||||
response.concat("<h3>Nuki Lock Access Control</h3>");
|
||||
response.concat("<input type=\"button\" value=\"Allow all\" style=\"margin-right: 10px;\" onclick=\"");
|
||||
response.concat("for(el of document.getElementsByClassName('chk_access_lock')){if(el.constructor.name==='HTMLInputElement'&&el.type==='checkbox')el.checked=true;}\">");
|
||||
response.concat("<input type=\"button\" value=\"Disallow all\" onclick=\"");
|
||||
response.concat("for(el of document.getElementsByClassName('chk_access_lock')){if(el.constructor.name==='HTMLInputElement'&&el.type==='checkbox')el.checked=false;}\">");
|
||||
response.concat("<table><tr><th>Action</th><th>Allowed</th></tr>");
|
||||
|
||||
printCheckBox(response, "ACLLCKLCK", "Lock", ((int)aclPrefs[0] == 1));
|
||||
printCheckBox(response, "ACLLCKUNLCK", "Unlock", ((int)aclPrefs[1] == 1));
|
||||
printCheckBox(response, "ACLLCKUNLTCH", "Unlatch", ((int)aclPrefs[2] == 1));
|
||||
printCheckBox(response, "ACLLCKLNG", "Lock N Go", ((int)aclPrefs[3] == 1));
|
||||
printCheckBox(response, "ACLLCKLNGU", "Lock N Go Unlatch", ((int)aclPrefs[4] == 1));
|
||||
printCheckBox(response, "ACLLCKFLLCK", "Full Lock", ((int)aclPrefs[5] == 1));
|
||||
printCheckBox(response, "ACLLCKFOB1", "Fob Action 1", ((int)aclPrefs[6] == 1));
|
||||
printCheckBox(response, "ACLLCKFOB2", "Fob Action 2", ((int)aclPrefs[7] == 1));
|
||||
printCheckBox(response, "ACLLCKFOB3", "Fob Action 3", ((int)aclPrefs[8] == 1));
|
||||
printCheckBox(response, "ACLLCKLCK", "Lock", ((int)aclPrefs[0] == 1), "chk_access_lock");
|
||||
printCheckBox(response, "ACLLCKUNLCK", "Unlock", ((int)aclPrefs[1] == 1), "chk_access_lock");
|
||||
printCheckBox(response, "ACLLCKUNLTCH", "Unlatch", ((int)aclPrefs[2] == 1), "chk_access_lock");
|
||||
printCheckBox(response, "ACLLCKLNG", "Lock N Go", ((int)aclPrefs[3] == 1), "chk_access_lock");
|
||||
printCheckBox(response, "ACLLCKLNGU", "Lock N Go Unlatch", ((int)aclPrefs[4] == 1), "chk_access_lock");
|
||||
printCheckBox(response, "ACLLCKFLLCK", "Full Lock", ((int)aclPrefs[5] == 1), "chk_access_lock");
|
||||
printCheckBox(response, "ACLLCKFOB1", "Fob Action 1", ((int)aclPrefs[6] == 1), "chk_access_lock");
|
||||
printCheckBox(response, "ACLLCKFOB2", "Fob Action 2", ((int)aclPrefs[7] == 1), "chk_access_lock");
|
||||
printCheckBox(response, "ACLLCKFOB3", "Fob Action 3", ((int)aclPrefs[8] == 1), "chk_access_lock");
|
||||
response.concat("</table><br>");
|
||||
|
||||
response.concat("<h3>Nuki Lock Config Control (Requires PIN to be set)</h3>");
|
||||
response.concat("<input type=\"button\" value=\"Allow all\" style=\"margin-right: 10px;\" onclick=\"");
|
||||
response.concat("for(el of document.getElementsByClassName('chk_config_lock')){if(el.constructor.name==='HTMLInputElement'&&el.type==='checkbox')el.checked=true;}\">");
|
||||
response.concat("<input type=\"button\" value=\"Disallow all\" onclick=\"");
|
||||
response.concat("for(el of document.getElementsByClassName('chk_config_lock')){if(el.constructor.name==='HTMLInputElement'&&el.type==='checkbox')el.checked=false;}\">");
|
||||
response.concat("<table><tr><th>Change</th><th>Allowed</th></tr>");
|
||||
|
||||
printCheckBox(response, "CONFLCKNAME", "Name", ((int)basicLockConfigAclPrefs[0] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKLAT", "Latitude", ((int)basicLockConfigAclPrefs[1] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKLONG", "Longitude", ((int)basicLockConfigAclPrefs[2] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKAUNL", "Auto unlatch", ((int)basicLockConfigAclPrefs[3] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKPRENA", "Pairing enabled", ((int)basicLockConfigAclPrefs[4] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKBTENA", "Button enabled", ((int)basicLockConfigAclPrefs[5] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKLEDENA", "LED flash enabled", ((int)basicLockConfigAclPrefs[6] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKLEDBR", "LED brightness", ((int)basicLockConfigAclPrefs[7] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKTZOFF", "Timezone offset", ((int)basicLockConfigAclPrefs[8] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKDSTM", "DST mode", ((int)basicLockConfigAclPrefs[9] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKFOB1", "Fob Action 1", ((int)basicLockConfigAclPrefs[10] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKFOB2", "Fob Action 2", ((int)basicLockConfigAclPrefs[11] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKFOB3", "Fob Action 3", ((int)basicLockConfigAclPrefs[12] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKSGLLCK", "Single Lock", ((int)basicLockConfigAclPrefs[13] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKADVM", "Advertising Mode", ((int)basicLockConfigAclPrefs[14] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKTZID", "Timezone ID", ((int)basicLockConfigAclPrefs[15] == 1), "chk_config_lock");
|
||||
|
||||
printCheckBox(response, "CONFLCKUPOD", "Unlocked Position Offset Degrees", ((int)advancedLockConfigAclPrefs[0] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKLPOD", "Locked Position Offset Degrees", ((int)advancedLockConfigAclPrefs[1] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKSLPOD", "Single Locked Position Offset Degrees", ((int)advancedLockConfigAclPrefs[2] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKUTLTOD", "Unlocked To Locked Transition Offset Degrees", ((int)advancedLockConfigAclPrefs[3] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKLNGT", "Lock n Go timeout", ((int)advancedLockConfigAclPrefs[4] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKSBPA", "Single button press action", ((int)advancedLockConfigAclPrefs[5] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKDBPA", "Double button press action", ((int)advancedLockConfigAclPrefs[6] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKDC", "Detached cylinder", ((int)advancedLockConfigAclPrefs[7] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKBATT", "Battery type", ((int)advancedLockConfigAclPrefs[8] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKABTD", "Automatic battery type detection", ((int)advancedLockConfigAclPrefs[9] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKUNLD", "Unlatch duration", ((int)advancedLockConfigAclPrefs[10] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKALT", "Auto lock timeout", ((int)advancedLockConfigAclPrefs[11] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKAUNLD", "Auto unlock disabled", ((int)advancedLockConfigAclPrefs[12] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKNMENA", "Nightmode enabled", ((int)advancedLockConfigAclPrefs[13] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKNMST", "Nightmode start time", ((int)advancedLockConfigAclPrefs[14] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKNMET", "Nightmode end time", ((int)advancedLockConfigAclPrefs[15] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKNMALENA", "Nightmode auto lock enabled", ((int)advancedLockConfigAclPrefs[16] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKNMAULD", "Nightmode auto unlock disabled", ((int)advancedLockConfigAclPrefs[17] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKNMLOS", "Nightmode immediate lock on start", ((int)advancedLockConfigAclPrefs[18] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKALENA", "Auto lock enabled", ((int)advancedLockConfigAclPrefs[19] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKIALENA", "Immediate auto lock enabled", ((int)advancedLockConfigAclPrefs[20] == 1), "chk_config_lock");
|
||||
printCheckBox(response, "CONFLCKAUENA", "Auto update enabled", ((int)advancedLockConfigAclPrefs[21] == 1), "chk_config_lock");
|
||||
response.concat("</table><br>");
|
||||
}
|
||||
if(_nukiOpener != nullptr)
|
||||
{
|
||||
uint32_t basicOpenerConfigAclPrefs[16];
|
||||
_preferences->getBytes(preference_conf_opener_basic_acl, &basicOpenerConfigAclPrefs, sizeof(basicOpenerConfigAclPrefs));
|
||||
uint32_t advancedOpenerConfigAclPrefs[22];
|
||||
_preferences->getBytes(preference_conf_opener_advanced_acl, &advancedOpenerConfigAclPrefs, sizeof(advancedOpenerConfigAclPrefs));
|
||||
|
||||
response.concat("<h3>Nuki Opener Access Control</h3>");
|
||||
response.concat("<input type=\"button\" value=\"Allow all\" style=\"margin-right: 10px;\" onclick=\"");
|
||||
response.concat("for(el of document.getElementsByClassName('chk_access_opener')){if(el.constructor.name==='HTMLInputElement'&&el.type==='checkbox')el.checked=true;}\">");
|
||||
response.concat("<input type=\"button\" value=\"Disallow all\" onclick=\"");
|
||||
response.concat("for(el of document.getElementsByClassName('chk_access_opener')){if(el.constructor.name==='HTMLInputElement'&&el.type==='checkbox')el.checked=false;}\">");
|
||||
response.concat("<table><tr><th>Action</th><th>Allowed</th></tr>");
|
||||
|
||||
printCheckBox(response, "ACLOPNUNLCK", "Activate Ring-to-Open", ((int)aclPrefs[9] == 1));
|
||||
printCheckBox(response, "ACLOPNLCK", "Deactivate Ring-to-Open", ((int)aclPrefs[10] == 1));
|
||||
printCheckBox(response, "ACLOPNUNLTCH", "Electric Strike Actuation", ((int)aclPrefs[11] == 1));
|
||||
printCheckBox(response, "ACLOPNUNLCKCM", "Activate Continuous Mode", ((int)aclPrefs[12] == 1));
|
||||
printCheckBox(response, "ACLOPNLCKCM", "Deactivate Continuous Mode", ((int)aclPrefs[13] == 1));
|
||||
printCheckBox(response, "ACLOPNFOB1", "Fob Action 1", ((int)aclPrefs[14] == 1));
|
||||
printCheckBox(response, "ACLOPNFOB2", "Fob Action 2", ((int)aclPrefs[15] == 1));
|
||||
printCheckBox(response, "ACLOPNFOB3", "Fob Action 3", ((int)aclPrefs[16] == 1));
|
||||
printCheckBox(response, "ACLOPNUNLCK", "Activate Ring-to-Open", ((int)aclPrefs[9] == 1), "chk_access_opener");
|
||||
printCheckBox(response, "ACLOPNLCK", "Deactivate Ring-to-Open", ((int)aclPrefs[10] == 1), "chk_access_opener");
|
||||
printCheckBox(response, "ACLOPNUNLTCH", "Electric Strike Actuation", ((int)aclPrefs[11] == 1), "chk_access_opener");
|
||||
printCheckBox(response, "ACLOPNUNLCKCM", "Activate Continuous Mode", ((int)aclPrefs[12] == 1), "chk_access_opener");
|
||||
printCheckBox(response, "ACLOPNLCKCM", "Deactivate Continuous Mode", ((int)aclPrefs[13] == 1), "chk_access_opener");
|
||||
printCheckBox(response, "ACLOPNFOB1", "Fob Action 1", ((int)aclPrefs[14] == 1), "chk_access_opener");
|
||||
printCheckBox(response, "ACLOPNFOB2", "Fob Action 2", ((int)aclPrefs[15] == 1), "chk_access_opener");
|
||||
printCheckBox(response, "ACLOPNFOB3", "Fob Action 3", ((int)aclPrefs[16] == 1), "chk_access_opener");
|
||||
response.concat("</table><br>");
|
||||
|
||||
response.concat("<h3>Nuki Opener Config Control (Requires PIN to be set)</h3>");
|
||||
response.concat("<input type=\"button\" value=\"Allow all\" style=\"margin-right: 10px;\" onclick=\"");
|
||||
response.concat("for(el of document.getElementsByClassName('chk_config_opener')){if(el.constructor.name==='HTMLInputElement'&&el.type==='checkbox')el.checked=true;}\">");
|
||||
response.concat("<input type=\"button\" value=\"Disallow all\" onclick=\"");
|
||||
response.concat("for(el of document.getElementsByClassName('chk_config_opener')){if(el.constructor.name==='HTMLInputElement'&&el.type==='checkbox')el.checked=false;}\">");
|
||||
response.concat("<table><tr><th>Change</th><th>Allowed</th></tr>");
|
||||
|
||||
printCheckBox(response, "CONFOPNNAME", "Name", ((int)basicOpenerConfigAclPrefs[0] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNLAT", "Latitude", ((int)basicOpenerConfigAclPrefs[1] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNLONG", "Longitude", ((int)basicOpenerConfigAclPrefs[2] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNPRENA", "Pairing enabled", ((int)basicOpenerConfigAclPrefs[3] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNBTENA", "Button enabled", ((int)basicOpenerConfigAclPrefs[4] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNLEDENA", "LED flash enabled", ((int)basicOpenerConfigAclPrefs[5] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNTZOFF", "Timezone offset", ((int)basicOpenerConfigAclPrefs[6] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNDSTM", "DST mode", ((int)basicOpenerConfigAclPrefs[7] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNFOB1", "Fob Action 1", ((int)basicOpenerConfigAclPrefs[8] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNFOB2", "Fob Action 2", ((int)basicOpenerConfigAclPrefs[9] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNFOB3", "Fob Action 3", ((int)basicOpenerConfigAclPrefs[10] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNOPM", "Operating Mode", ((int)basicOpenerConfigAclPrefs[11] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNADVM", "Advertising Mode", ((int)basicOpenerConfigAclPrefs[12] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNTZID", "Timezone ID", ((int)basicOpenerConfigAclPrefs[13] == 1), "chk_config_opener");
|
||||
|
||||
printCheckBox(response, "CONFOPNICID", "Intercom ID", ((int)advancedOpenerConfigAclPrefs[0] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNBUSMS", "BUS mode Switch", ((int)advancedOpenerConfigAclPrefs[1] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNSCDUR", "Short Circuit Duration", ((int)advancedOpenerConfigAclPrefs[2] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNESD", "Eletric Strike Delay", ((int)advancedOpenerConfigAclPrefs[3] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNRESD", "Random Electric Strike Delay", ((int)advancedOpenerConfigAclPrefs[4] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNESDUR", "Electric Strike Duration", ((int)advancedOpenerConfigAclPrefs[5] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNDRTOAR", "Disable RTO after ring", ((int)advancedOpenerConfigAclPrefs[6] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNRTOT", "RTO timeout", ((int)advancedOpenerConfigAclPrefs[7] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNDRBSUP", "Doorbell suppression", ((int)advancedOpenerConfigAclPrefs[8] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNDRBSUPDUR", "Doorbell suppression duration", ((int)advancedOpenerConfigAclPrefs[9] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNSRING", "Sound Ring", ((int)advancedOpenerConfigAclPrefs[10] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNSOPN", "Sound Open", ((int)advancedOpenerConfigAclPrefs[11] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNSRTO", "Sound RTO", ((int)advancedOpenerConfigAclPrefs[12] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNSCM", "Sound CM", ((int)advancedOpenerConfigAclPrefs[13] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNSCFRM", "Sound confirmation", ((int)advancedOpenerConfigAclPrefs[14] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNSLVL", "Sound level", ((int)advancedOpenerConfigAclPrefs[15] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNSBPA", "Single button press action", ((int)advancedOpenerConfigAclPrefs[16] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNDBPA", "Double button press action", ((int)advancedOpenerConfigAclPrefs[17] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNBATT", "Battery type", ((int)advancedOpenerConfigAclPrefs[18] == 1), "chk_config_opener");
|
||||
printCheckBox(response, "CONFOPNABTD", "Automatic battery type detection", ((int)advancedOpenerConfigAclPrefs[19] == 1), "chk_config_opener");
|
||||
response.concat("</table><br>");
|
||||
}
|
||||
response.concat("<br><input type=\"submit\" name=\"submit\" value=\"Save\">");
|
||||
@@ -1047,12 +1442,15 @@ void WebCfgServer::buildNukiConfigHtml(String &response)
|
||||
response.concat("<form method=\"post\" action=\"savecfg\">");
|
||||
response.concat("<h3>Basic Nuki Configuration</h3>");
|
||||
response.concat("<table>");
|
||||
printCheckBox(response, "LOCKENA", "Nuki Smartlock enabled", _preferences->getBool(preference_lock_enabled));
|
||||
printCheckBox(response, "LOCKENA", "Nuki Smartlock enabled", _preferences->getBool(preference_lock_enabled), "");
|
||||
|
||||
if(_preferences->getBool(preference_lock_enabled))
|
||||
{
|
||||
printInputField(response, "MQTTPATH", "MQTT Nuki Smartlock Path", _preferences->getString(preference_mqtt_lock_path).c_str(), 180);
|
||||
}
|
||||
printCheckBox(response, "OPENA", "Nuki Opener enabled", _preferences->getBool(preference_opener_enabled));
|
||||
|
||||
printCheckBox(response, "OPENA", "Nuki Opener enabled", _preferences->getBool(preference_opener_enabled), "");
|
||||
|
||||
if(_preferences->getBool(preference_opener_enabled))
|
||||
{
|
||||
printInputField(response, "MQTTOPPATH", "MQTT Nuki Opener Path", _preferences->getString(preference_mqtt_opener_path).c_str(), 180);
|
||||
@@ -1071,7 +1469,7 @@ void WebCfgServer::buildNukiConfigHtml(String &response)
|
||||
}
|
||||
printInputField(response, "NRTRY", "Number of retries if command failed", _preferences->getInt(preference_command_nr_of_retries), 10);
|
||||
printInputField(response, "TRYDLY", "Delay between retries (milliseconds)", _preferences->getInt(preference_command_retry_delay), 10);
|
||||
printCheckBox(response, "REGAPP", "Nuki Bridge is running alongside Nuki Hub (needs re-pairing if changed)", _preferences->getBool(preference_register_as_app));
|
||||
printCheckBox(response, "REGAPP", "Nuki Bridge is running alongside Nuki Hub (needs re-pairing if changed)", _preferences->getBool(preference_register_as_app), "");
|
||||
printInputField(response, "PRDTMO", "Presence detection timeout (seconds; -1 to disable)", _preferences->getInt(preference_presence_detection_timeout), 10);
|
||||
printInputField(response, "RSBC", "Restart if bluetooth beacons not received (seconds; -1 to disable)", _preferences->getInt(preference_restart_ble_beacon_lost), 10);
|
||||
response.concat("</table>");
|
||||
@@ -1152,6 +1550,11 @@ void WebCfgServer::buildInfoHtml(String &response)
|
||||
|
||||
if(_nuki != nullptr)
|
||||
{
|
||||
uint32_t basicLockConfigAclPrefs[16];
|
||||
_preferences->getBytes(preference_conf_lock_basic_acl, &basicLockConfigAclPrefs, sizeof(basicLockConfigAclPrefs));
|
||||
uint32_t advancedLockConfigAclPrefs[22];
|
||||
_preferences->getBytes(preference_conf_lock_advanced_acl, &advancedLockConfigAclPrefs, sizeof(advancedLockConfigAclPrefs));
|
||||
|
||||
response.concat("Lock firmware version: ");
|
||||
response.concat(_nuki->firmwareVersion().c_str());
|
||||
response.concat("\nLock hardware version: ");
|
||||
@@ -1182,10 +1585,90 @@ void WebCfgServer::buildInfoHtml(String &response)
|
||||
response.concat((int)aclPrefs[7] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock ACL (Fob Action 3): ");
|
||||
response.concat((int)aclPrefs[8] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Name): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[0] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Latitude): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[1] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Longitude): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[2] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Auto Unlatch): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[3] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Pairing enabled): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[4] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Button enabled): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[5] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (LED flash enabled): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[6] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (LED brightness): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[7] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Timezone offset): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[8] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (DST mode): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[9] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Fob Action 1): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[10] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Fob Action 2): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[11] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Fob Action 3): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[12] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Single Lock): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[13] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Advertising Mode): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[14] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Timezone ID): ");
|
||||
response.concat((int)basicLockConfigAclPrefs[15] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Unlocked Position Offset Degrees): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[0] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Locked Position Offset Degrees): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[1] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Single Locked Position Offset Degrees): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[2] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Unlocked To Locked Transition Offset Degrees): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[3] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Lock n Go timeout): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[4] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Single button press action): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[5] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Double button press action): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[6] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Detached cylinder): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[7] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Battery type): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[8] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Automatic battery type detection): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[9] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Unlatch duration): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[10] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Auto lock timeout): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[11] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Auto unlock disabled): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[12] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Nightmode enabled): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[13] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Nightmode start time): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[14] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Nightmode end time): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[15] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Nightmode auto lock enabled): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[16] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Nightmode auto unlock disabled): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[17] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Nightmode immediate lock on start): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[18] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Auto lock enabled): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[19] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Immediate auto lock enabled): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[20] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Lock config ACL (Auto update enabled): ");
|
||||
response.concat((int)advancedLockConfigAclPrefs[21] ? "Allowed\n" : "Disallowed\n");
|
||||
}
|
||||
|
||||
if(_nukiOpener != nullptr)
|
||||
{
|
||||
uint32_t basicOpenerConfigAclPrefs[16];
|
||||
_preferences->getBytes(preference_conf_opener_basic_acl, &basicOpenerConfigAclPrefs, sizeof(basicOpenerConfigAclPrefs));
|
||||
uint32_t advancedOpenerConfigAclPrefs[22];
|
||||
_preferences->getBytes(preference_conf_opener_advanced_acl, &advancedOpenerConfigAclPrefs, sizeof(advancedOpenerConfigAclPrefs));
|
||||
response.concat("Opener firmware version: ");
|
||||
response.concat(_nukiOpener->firmwareVersion().c_str());
|
||||
response.concat("\nOpener hardware version: ");
|
||||
@@ -1211,6 +1694,74 @@ void WebCfgServer::buildInfoHtml(String &response)
|
||||
response.concat((int)aclPrefs[15] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener ACL (Fob Action 3): ");
|
||||
response.concat((int)aclPrefs[16] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Name): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[0] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Latitude): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[1] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Longitude): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[2] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Pairing enabled): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[3] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Button enabled): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[4] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (LED flash enabled): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[5] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Timezone offset): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[6] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (DST mode): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[7] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Fob Action 1): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[8] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Fob Action 2): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[9] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Fob Action 3): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[10] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Operating Mode): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[11] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Advertising Mode): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[12] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Timezone ID): ");
|
||||
response.concat((int)basicOpenerConfigAclPrefs[13] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Intercom ID): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[0] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (BUS mode Switch): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[1] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Short Circuit Duration): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[2] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Eletric Strike Delay): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[3] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Random Electric Strike Delay): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[4] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Electric Strike Duration): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[5] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Disable RTO after ring): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[6] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (RTO timeout): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[7] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Doorbell suppression): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[8] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Doorbell suppression duration): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[9] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Sound Ring): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[10] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Sound Open): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[11] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Sound RTO): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[12] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Sound CM): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[13] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Sound confirmation): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[14] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Sound level): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[15] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Single button press action): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[16] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Double button press action): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[17] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Battery type): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[18] ? "Allowed\n" : "Disallowed\n");
|
||||
response.concat("Opener config ACL (Automatic battery type detection): ");
|
||||
response.concat((int)advancedOpenerConfigAclPrefs[19] ? "Allowed\n" : "Disallowed\n");
|
||||
}
|
||||
|
||||
response.concat("Network device: ");
|
||||
@@ -1350,7 +1901,7 @@ void WebCfgServer::printInputField(String& response,
|
||||
printInputField(response, token, description, valueStr, maxLength);
|
||||
}
|
||||
|
||||
void WebCfgServer::printCheckBox(String &response, const char *token, const char *description, const bool value)
|
||||
void WebCfgServer::printCheckBox(String &response, const char *token, const char *description, const bool value, const char *htmlClass)
|
||||
{
|
||||
response.concat("<tr><td>");
|
||||
response.concat(description);
|
||||
@@ -1363,6 +1914,10 @@ void WebCfgServer::printCheckBox(String &response, const char *token, const char
|
||||
|
||||
response.concat("<input type=checkbox name=\"");
|
||||
response.concat(token);
|
||||
|
||||
response.concat("\" class=\"");
|
||||
response.concat(htmlClass);
|
||||
|
||||
response.concat("\" value=\"1\"");
|
||||
response.concat(value ? " checked=\"checked\"" : "");
|
||||
response.concat("/></td></tr>");
|
||||
|
||||
Reference in New Issue
Block a user