Merge branch 'master' into change-ring-to-event
This commit is contained in:
4
Config.h
4
Config.h
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
#define NUKI_HUB_VERSION "8.32"
|
#define NUKI_HUB_VERSION "8.32"
|
||||||
|
|
||||||
|
#define GITHUB_LATEST_RELEASE_URL "https://github.com/technyon/nuki_hub/releases/latest"
|
||||||
|
#define GITHUB_LATEST_RELEASE_API_URL "https://api.github.com/repos/technyon/nuki_hub/releases/latest"
|
||||||
|
#define GITHUB_LATEST_RELEASE_BINARY_URL "https://github.com/technyon/nuki_hub/raw/master/webflash/nuki_hub.bin"
|
||||||
|
|
||||||
#define MQTT_QOS_LEVEL 1
|
#define MQTT_QOS_LEVEL 1
|
||||||
#define MQTT_CLEAN_SESSIONS false
|
#define MQTT_CLEAN_SESSIONS false
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#define mqtt_topic_info_hardware_version "/info/hardwareVersion"
|
#define mqtt_topic_info_hardware_version "/info/hardwareVersion"
|
||||||
#define mqtt_topic_info_firmware_version "/info/firmwareVersion"
|
#define mqtt_topic_info_firmware_version "/info/firmwareVersion"
|
||||||
#define mqtt_topic_info_nuki_hub_version "/info/nukiHubVersion"
|
#define mqtt_topic_info_nuki_hub_version "/info/nukiHubVersion"
|
||||||
|
#define mqtt_topic_info_nuki_hub_latest "/info/nukiHubLatest"
|
||||||
#define mqtt_topic_info_nuki_hub_ip "/info/nukiHubIp"
|
#define mqtt_topic_info_nuki_hub_ip "/info/nukiHubIp"
|
||||||
|
|
||||||
#define mqtt_topic_keypad "/keypad"
|
#define mqtt_topic_keypad "/keypad"
|
||||||
|
|||||||
197
Network.cpp
197
Network.cpp
@@ -357,7 +357,32 @@ bool Network::update()
|
|||||||
}
|
}
|
||||||
_lastMaintenanceTs = ts;
|
_lastMaintenanceTs = ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(_preferences->getBool(preference_check_updates))
|
||||||
|
{
|
||||||
|
if(_lastUpdateCheckTs == 0 || (ts - _lastUpdateCheckTs) > 86400000)
|
||||||
|
{
|
||||||
|
_lastUpdateCheckTs = ts;
|
||||||
|
|
||||||
|
https.useHTTP10(true);
|
||||||
|
https.begin(GITHUB_LATEST_RELEASE_API_URL);
|
||||||
|
|
||||||
|
int httpResponseCode = https.GET();
|
||||||
|
|
||||||
|
if (httpResponseCode == HTTP_CODE_OK || httpResponseCode == HTTP_CODE_MOVED_PERMANENTLY) {
|
||||||
|
DynamicJsonDocument doc(6144);
|
||||||
|
DeserializationError jsonError = deserializeJson(doc, https.getStream());
|
||||||
|
|
||||||
|
if (!jsonError) {
|
||||||
|
_latestVersion = doc["tag_name"];
|
||||||
|
publishString(_maintenancePathPrefix, mqtt_topic_info_nuki_hub_latest, _latestVersion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
https.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(const auto& gpioTs : _gpioTs)
|
for(const auto& gpioTs : _gpioTs)
|
||||||
{
|
{
|
||||||
uint8_t pin = gpioTs.first;
|
uint8_t pin = gpioTs.first;
|
||||||
@@ -644,6 +669,11 @@ int Network::mqttConnectionState()
|
|||||||
return _mqttConnectionState;
|
return _mqttConnectionState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* Network::latestHubVersion()
|
||||||
|
{
|
||||||
|
return _latestVersion;
|
||||||
|
}
|
||||||
|
|
||||||
bool Network::encryptionSupported()
|
bool Network::encryptionSupported()
|
||||||
{
|
{
|
||||||
return _device->supportsEncryption();
|
return _device->supportsEncryption();
|
||||||
@@ -915,6 +945,54 @@ void Network::publishHASSConfig(char* deviceType, const char* baseTopic, char* n
|
|||||||
"",
|
"",
|
||||||
{ { "enabled_by_default", "true" },
|
{ { "enabled_by_default", "true" },
|
||||||
{"ic", "mdi:counter"}});
|
{"ic", "mdi:counter"}});
|
||||||
|
|
||||||
|
if(_preferences->getBool(preference_check_updates))
|
||||||
|
{
|
||||||
|
// NUKI Hub latest
|
||||||
|
publishHassTopic("sensor",
|
||||||
|
"nuki_hub_latest",
|
||||||
|
uidString,
|
||||||
|
"_nuki_hub_latest",
|
||||||
|
"NUKI Hub latest",
|
||||||
|
name,
|
||||||
|
baseTopic,
|
||||||
|
_lockPath + mqtt_topic_info_nuki_hub_latest,
|
||||||
|
deviceType,
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"diagnostic",
|
||||||
|
"",
|
||||||
|
{ { "enabled_by_default", "true" },
|
||||||
|
{"ic", "mdi:counter"}});
|
||||||
|
|
||||||
|
// NUKI Hub update
|
||||||
|
char latest_version_topic[250];
|
||||||
|
_lockPath.toCharArray(latest_version_topic,_lockPath.length() + 1);
|
||||||
|
strcat(latest_version_topic, mqtt_topic_info_nuki_hub_latest);
|
||||||
|
|
||||||
|
publishHassTopic("update",
|
||||||
|
"nuki_hub_update",
|
||||||
|
uidString,
|
||||||
|
"_nuki_hub_update",
|
||||||
|
"NUKI Hub firmware update",
|
||||||
|
name,
|
||||||
|
baseTopic,
|
||||||
|
_lockPath + mqtt_topic_info_nuki_hub_version,
|
||||||
|
deviceType,
|
||||||
|
"firmware",
|
||||||
|
"",
|
||||||
|
"diagnostic",
|
||||||
|
"",
|
||||||
|
{ { "enabled_by_default", "true" },
|
||||||
|
{ "entity_picture", "https://raw.githubusercontent.com/technyon/nuki_hub/master/icon/favicon-32x32.png" },
|
||||||
|
{ "release_url", GITHUB_LATEST_RELEASE_URL },
|
||||||
|
{ "latest_version_topic", latest_version_topic }});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
removeHassTopic("sensor", "nuki_hub_latest", uidString);
|
||||||
|
removeHassTopic("update", "nuki_hub_update", uidString);
|
||||||
|
}
|
||||||
|
|
||||||
// Nuki Hub IP Address
|
// Nuki Hub IP Address
|
||||||
publishHassTopic("sensor",
|
publishHassTopic("sensor",
|
||||||
@@ -1031,8 +1109,6 @@ void Network::publishHASSConfigAdditionalButtons(char *deviceType, const char *b
|
|||||||
{ "pl_prs", "lockNgoUnlatch" }});
|
{ "pl_prs", "lockNgoUnlatch" }});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//json["cmd_t"] = String("~") + String(mqtt_topic_lock_action);
|
|
||||||
void Network::publishHASSConfigBatLevel(char *deviceType, const char *baseTopic, char *name, char *uidString)
|
void Network::publishHASSConfigBatLevel(char *deviceType, const char *baseTopic, char *name, char *uidString)
|
||||||
{
|
{
|
||||||
String discoveryTopic = _preferences->getString(preference_mqtt_hass_discovery);
|
String discoveryTopic = _preferences->getString(preference_mqtt_hass_discovery);
|
||||||
@@ -1308,95 +1384,34 @@ void Network::removeHASSConfig(char* uidString)
|
|||||||
|
|
||||||
if(discoveryTopic != "")
|
if(discoveryTopic != "")
|
||||||
{
|
{
|
||||||
String path = discoveryTopic;
|
removeHassTopic("lock", "smartlock", uidString);
|
||||||
path.concat("/lock/");
|
removeHassTopic("binary_sensor", "battery_low", uidString);
|
||||||
path.concat(uidString);
|
removeHassTopic("binary_sensor", "keypad_battery_low", uidString);
|
||||||
path.concat("/smartlock/config");
|
removeHassTopic("sensor", "battery_voltage", uidString);
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
removeHassTopic("sensor", "trigger", uidString);
|
||||||
|
removeHassTopic("binary_sensor", "mqtt_connected", uidString);
|
||||||
path = discoveryTopic;
|
removeHassTopic("switch", "reset", uidString);
|
||||||
path.concat("/binary_sensor/");
|
removeHassTopic("sensor", "firmware_version", uidString);
|
||||||
path.concat(uidString);
|
removeHassTopic("sensor", "hardware_version", uidString);
|
||||||
path.concat("/battery_low/config");
|
removeHassTopic("sensor", "nuki_hub_version", uidString);
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
removeHassTopic("sensor", "nuki_hub_latest", uidString);
|
||||||
|
removeHassTopic("update", "nuki_hub_update", uidString);
|
||||||
path = discoveryTopic;
|
removeHassTopic("sensor", "nuki_hub_ip", uidString);
|
||||||
path.concat("/button/");
|
removeHassTopic("switch", "led_enabled", uidString);
|
||||||
path.concat(uidString);
|
removeHassTopic("switch", "button_enabled", uidString);
|
||||||
path.concat("/lockngo/config");
|
removeHassTopic("button", "unlatch", uidString);
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
removeHassTopic("button", "lockngo", uidString);
|
||||||
|
removeHassTopic("button", "lockngounlatch", uidString);
|
||||||
path = discoveryTopic;
|
removeHassTopic("sensor", "battery_level", uidString);
|
||||||
path.concat("/button/");
|
removeHassTopic("binary_sensor", "door_sensor", uidString);
|
||||||
path.concat(uidString);
|
removeHassTopic("binary_sensor", "ring", uidString);
|
||||||
path.concat("/lockngounlatch/config");
|
removeHassTopic("number", "led_brightness", uidString);
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
removeHassTopic("sensor", "sound_level", uidString);
|
||||||
|
removeHassTopic("number", "sound_level", uidString);
|
||||||
path = discoveryTopic;
|
removeHassTopic("sensor", "last_action_authorization", uidString);
|
||||||
path.concat("/button/");
|
removeHassTopic("sensor", "keypad_status", uidString);
|
||||||
path.concat(uidString);
|
removeHassTopic("sensor", "wifi_signal_strength", uidString);
|
||||||
path.concat("/unlatch/config");
|
removeHassTopic("sensor", "bluetooth_signal_strength", uidString);
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
|
||||||
|
|
||||||
path = discoveryTopic;
|
|
||||||
path.concat("/sensor/");
|
|
||||||
path.concat(uidString);
|
|
||||||
path.concat("/battery_voltage/config");
|
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
|
||||||
|
|
||||||
path = discoveryTopic;
|
|
||||||
path.concat("/sensor/");
|
|
||||||
path.concat(uidString);
|
|
||||||
path.concat("/trigger/config");
|
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
|
||||||
|
|
||||||
path = discoveryTopic;
|
|
||||||
path.concat("/sensor/");
|
|
||||||
path.concat(uidString);
|
|
||||||
path.concat("/battery_level/config");
|
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
|
||||||
|
|
||||||
path = discoveryTopic;
|
|
||||||
path.concat("/sensor/");
|
|
||||||
path.concat(uidString);
|
|
||||||
path.concat("/sound_level/config");
|
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
|
||||||
|
|
||||||
path = discoveryTopic;
|
|
||||||
path.concat("/sensor/");
|
|
||||||
path.concat(uidString);
|
|
||||||
path.concat("/nuki_hub_ip/config");
|
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
|
||||||
|
|
||||||
path = discoveryTopic;
|
|
||||||
path.concat("/number/");
|
|
||||||
path.concat(uidString);
|
|
||||||
path.concat("/sound_level/config");
|
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
|
||||||
|
|
||||||
path = discoveryTopic;
|
|
||||||
path.concat("/binary_sensor/");
|
|
||||||
path.concat(uidString);
|
|
||||||
path.concat("/door_sensor/config");
|
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
|
||||||
|
|
||||||
path = discoveryTopic;
|
|
||||||
path.concat("/binary_sensor/");
|
|
||||||
path.concat(uidString);
|
|
||||||
path.concat("/ring/config");
|
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
|
||||||
|
|
||||||
path = discoveryTopic;
|
|
||||||
path.concat("/sensor/");
|
|
||||||
path.concat(uidString);
|
|
||||||
path.concat("/wifi_signal_strength/config");
|
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
|
||||||
|
|
||||||
path = discoveryTopic;
|
|
||||||
path.concat("/sensor/");
|
|
||||||
path.concat(uidString);
|
|
||||||
path.concat("/bluetooth_signal_strength/config");
|
|
||||||
_device->mqttPublish(path.c_str(), MQTT_QOS_LEVEL, true, "");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "MqttTopics.h"
|
#include "MqttTopics.h"
|
||||||
#include "Gpio.h"
|
#include "Gpio.h"
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
|
#include <HTTPClient.h>
|
||||||
|
|
||||||
enum class NetworkDeviceType
|
enum class NetworkDeviceType
|
||||||
{
|
{
|
||||||
@@ -63,6 +64,7 @@ public:
|
|||||||
void publishPresenceDetection(char* csv);
|
void publishPresenceDetection(char* csv);
|
||||||
|
|
||||||
int mqttConnectionState(); // 0 = not connected; 1 = connected; 2 = connected and mqtt processed
|
int mqttConnectionState(); // 0 = not connected; 1 = connected; 2 = connected and mqtt processed
|
||||||
|
const char* latestHubVersion();
|
||||||
bool encryptionSupported();
|
bool encryptionSupported();
|
||||||
const String networkDeviceName() const;
|
const String networkDeviceName() const;
|
||||||
|
|
||||||
@@ -126,6 +128,9 @@ private:
|
|||||||
char _mqttConnectionStateTopic[211] = {0};
|
char _mqttConnectionStateTopic[211] = {0};
|
||||||
String _lockPath;
|
String _lockPath;
|
||||||
|
|
||||||
|
const char* _latestVersion;
|
||||||
|
HTTPClient https;
|
||||||
|
|
||||||
Preferences* _preferences;
|
Preferences* _preferences;
|
||||||
Gpio* _gpio;
|
Gpio* _gpio;
|
||||||
IPConfiguration* _ipConfiguration = nullptr;
|
IPConfiguration* _ipConfiguration = nullptr;
|
||||||
@@ -152,6 +157,7 @@ private:
|
|||||||
|
|
||||||
unsigned long _lastConnectedTs = 0;
|
unsigned long _lastConnectedTs = 0;
|
||||||
unsigned long _lastMaintenanceTs = 0;
|
unsigned long _lastMaintenanceTs = 0;
|
||||||
|
unsigned long _lastUpdateCheckTs = 0;
|
||||||
unsigned long _lastRssiTs = 0;
|
unsigned long _lastRssiTs = 0;
|
||||||
bool _mqttEnabled = true;
|
bool _mqttEnabled = true;
|
||||||
static unsigned long _ignoreSubscriptionsTs;
|
static unsigned long _ignoreSubscriptionsTs;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#define preference_mqtt_lock_path "mqttpath"
|
#define preference_mqtt_lock_path "mqttpath"
|
||||||
#define preference_opener_enabled "openerena"
|
#define preference_opener_enabled "openerena"
|
||||||
#define preference_mqtt_opener_path "mqttoppath"
|
#define preference_mqtt_opener_path "mqttoppath"
|
||||||
|
#define preference_check_updates "checkupdates"
|
||||||
#define preference_lock_max_keypad_code_count "maxkpad"
|
#define preference_lock_max_keypad_code_count "maxkpad"
|
||||||
#define preference_opener_max_keypad_code_count "opmaxkpad"
|
#define preference_opener_max_keypad_code_count "opmaxkpad"
|
||||||
#define preference_mqtt_ca "mqttca"
|
#define preference_mqtt_ca "mqttca"
|
||||||
@@ -62,7 +63,7 @@ private:
|
|||||||
std::vector<char*> _keys =
|
std::vector<char*> _keys =
|
||||||
{
|
{
|
||||||
preference_started_before, preference_device_id_lock, preference_device_id_opener, preference_mqtt_broker, preference_mqtt_broker_port,
|
preference_started_before, preference_device_id_lock, preference_device_id_opener, preference_mqtt_broker, preference_mqtt_broker_port,
|
||||||
preference_mqtt_user, preference_mqtt_password, preference_mqtt_log_enabled, preference_lock_enabled,
|
preference_mqtt_user, preference_mqtt_password, preference_mqtt_log_enabled, preference_check_updates, preference_lock_enabled,
|
||||||
preference_mqtt_lock_path, preference_opener_enabled, preference_mqtt_opener_path,
|
preference_mqtt_lock_path, preference_opener_enabled, preference_mqtt_opener_path,
|
||||||
preference_lock_max_keypad_code_count, preference_opener_max_keypad_code_count, preference_mqtt_ca,
|
preference_lock_max_keypad_code_count, preference_opener_max_keypad_code_count, preference_mqtt_ca,
|
||||||
preference_mqtt_crt, preference_mqtt_key, preference_mqtt_hass_discovery, preference_mqtt_hass_cu_url,
|
preference_mqtt_crt, preference_mqtt_key, preference_mqtt_hass_discovery, preference_mqtt_hass_cu_url,
|
||||||
@@ -85,7 +86,7 @@ private:
|
|||||||
};
|
};
|
||||||
std::vector<char*> _boolPrefs =
|
std::vector<char*> _boolPrefs =
|
||||||
{
|
{
|
||||||
preference_started_before, preference_mqtt_log_enabled, preference_lock_enabled, preference_opener_enabled,
|
preference_started_before, preference_mqtt_log_enabled, preference_check_updates, preference_lock_enabled, preference_opener_enabled,
|
||||||
preference_restart_on_disconnect, preference_keypad_control_enabled, preference_register_as_app, preference_ip_dhcp_enabled,
|
preference_restart_on_disconnect, preference_keypad_control_enabled, preference_register_as_app, preference_ip_dhcp_enabled,
|
||||||
preference_publish_authdata, preference_has_mac_saved, preference_publish_debug_info, preference_network_wifi_fallback_disabled
|
preference_publish_authdata, preference_has_mac_saved, preference_publish_debug_info, preference_network_wifi_fallback_disabled
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ bool WebCfgServer::processArgs(String& message)
|
|||||||
{
|
{
|
||||||
_preferences->putString(preference_mqtt_hass_cu_url, value);
|
_preferences->putString(preference_mqtt_hass_cu_url, value);
|
||||||
configChanged = true;
|
configChanged = true;
|
||||||
}
|
}
|
||||||
else if(key == "HOSTNAME")
|
else if(key == "HOSTNAME")
|
||||||
{
|
{
|
||||||
_preferences->putString(preference_hostname, value);
|
_preferences->putString(preference_hostname, value);
|
||||||
@@ -377,6 +377,11 @@ bool WebCfgServer::processArgs(String& message)
|
|||||||
_preferences->putBool(preference_mqtt_log_enabled, (value == "1"));
|
_preferences->putBool(preference_mqtt_log_enabled, (value == "1"));
|
||||||
configChanged = true;
|
configChanged = true;
|
||||||
}
|
}
|
||||||
|
else if(key == "CHECKUPDATE")
|
||||||
|
{
|
||||||
|
_preferences->putBool(preference_check_updates, (value == "1"));
|
||||||
|
configChanged = true;
|
||||||
|
}
|
||||||
else if(key == "DHCPENA")
|
else if(key == "DHCPENA")
|
||||||
{
|
{
|
||||||
_preferences->putBool(preference_ip_dhcp_enabled, (value == "1"));
|
_preferences->putBool(preference_ip_dhcp_enabled, (value == "1"));
|
||||||
@@ -617,6 +622,16 @@ void WebCfgServer::buildHtml(String& response)
|
|||||||
printParameter(response, "Nuki Opener state", lockstateArr);
|
printParameter(response, "Nuki Opener state", lockstateArr);
|
||||||
}
|
}
|
||||||
printParameter(response, "Firmware", version.c_str(), "/info");
|
printParameter(response, "Firmware", version.c_str(), "/info");
|
||||||
|
|
||||||
|
const char* _latestVersion = _network->latestHubVersion();
|
||||||
|
|
||||||
|
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", _latestVersion, "/ota");
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
response.concat("</table><br><br>");
|
response.concat("</table><br><br>");
|
||||||
|
|
||||||
response.concat("<h3>MQTT and Network Configuration</h3>");
|
response.concat("<h3>MQTT and Network Configuration</h3>");
|
||||||
@@ -726,6 +741,18 @@ void WebCfgServer::buildOtaHtml(String &response, bool errored)
|
|||||||
|
|
||||||
response.concat("<form id=\"upform\" enctype=\"multipart/form-data\" action=\"/uploadota\" method=\"POST\"><input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"100000\" />Choose the updated nuki_hub.bin file to upload: <input name=\"uploadedfile\" type=\"file\" accept=\".bin\" /><br/>");
|
response.concat("<form id=\"upform\" enctype=\"multipart/form-data\" action=\"/uploadota\" method=\"POST\"><input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"100000\" />Choose the updated nuki_hub.bin file to upload: <input name=\"uploadedfile\" type=\"file\" accept=\".bin\" /><br/>");
|
||||||
response.concat("<br><input id=\"submitbtn\" type=\"submit\" value=\"Upload File\" /></form>");
|
response.concat("<br><input id=\"submitbtn\" type=\"submit\" value=\"Upload File\" /></form>");
|
||||||
|
|
||||||
|
if(_preferences->getBool(preference_check_updates))
|
||||||
|
{
|
||||||
|
response.concat("<button title=\"Open latest release on GitHub\" onclick=\" window.open('");
|
||||||
|
response.concat(GITHUB_LATEST_RELEASE_URL);
|
||||||
|
response.concat("', '_blank'); return false;\">Open latest release on GitHub</button>");
|
||||||
|
|
||||||
|
response.concat("<br><br><button title=\"Download latest binary from GitHub\" onclick=\" window.open('");
|
||||||
|
response.concat(GITHUB_LATEST_RELEASE_BINARY_URL);
|
||||||
|
response.concat("'); return false;\">Download latest binary from GitHub</button>");
|
||||||
|
}
|
||||||
|
|
||||||
response.concat("<div id=\"msgdiv\" style=\"visibility:hidden\">Initiating Over-the-air update. This will take about two minutes, please be patient.<br>You will be forwarded automatically when the update is complete.</div>");
|
response.concat("<div id=\"msgdiv\" style=\"visibility:hidden\">Initiating Over-the-air update. This will take about two minutes, please be patient.<br>You will be forwarded automatically when the update is complete.</div>");
|
||||||
response.concat("<script type=\"text/javascript\">");
|
response.concat("<script type=\"text/javascript\">");
|
||||||
response.concat("window.addEventListener('load', function () {");
|
response.concat("window.addEventListener('load', function () {");
|
||||||
@@ -779,6 +806,7 @@ void WebCfgServer::buildMqttConfigHtml(String &response)
|
|||||||
printInputField(response, "NETTIMEOUT", "Network Timeout until restart (seconds; -1 to disable)", _preferences->getInt(preference_network_timeout), 5);
|
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, "RSTDISC", "Restart on disconnect", _preferences->getBool(preference_restart_on_disconnect));
|
||||||
printCheckBox(response, "MQTTLOG", "Enable MQTT logging", _preferences->getBool(preference_mqtt_log_enabled));
|
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("</table>");
|
||||||
response.concat("* If no encryption is configured for the MQTT broker, leave empty. Only supported for WiFi connections.<br><br>");
|
response.concat("* If no encryption is configured for the MQTT broker, leave empty. Only supported for WiFi connections.<br><br>");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user