Merge branch 'technyon:master' into readme-update
This commit is contained in:
@@ -20,8 +20,8 @@ COPY lib /usr/src/nuki_hub/lib
|
|||||||
COPY networkDevices /usr/src/nuki_hub/networkDevices
|
COPY networkDevices /usr/src/nuki_hub/networkDevices
|
||||||
COPY CMakeLists.txt /usr/src/nuki_hub
|
COPY CMakeLists.txt /usr/src/nuki_hub
|
||||||
COPY index.html /usr/src/nuki_hub
|
COPY index.html /usr/src/nuki_hub
|
||||||
COPY *.h /usr/src/nuki_hub
|
COPY *.h /usr/src/nuki_hub/
|
||||||
COPY *.cpp /usr/src/nuki_hub
|
COPY *.cpp /usr/src/nuki_hub/
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/nuki_hub/build
|
RUN mkdir -p /usr/src/nuki_hub/build
|
||||||
|
|
||||||
|
|||||||
16
Network.cpp
16
Network.cpp
@@ -369,13 +369,20 @@ bool Network::update()
|
|||||||
|
|
||||||
int httpResponseCode = https.GET();
|
int httpResponseCode = https.GET();
|
||||||
|
|
||||||
if (httpResponseCode == HTTP_CODE_OK || httpResponseCode == HTTP_CODE_MOVED_PERMANENTLY) {
|
if (httpResponseCode == HTTP_CODE_OK || httpResponseCode == HTTP_CODE_MOVED_PERMANENTLY)
|
||||||
|
{
|
||||||
DynamicJsonDocument doc(6144);
|
DynamicJsonDocument doc(6144);
|
||||||
DeserializationError jsonError = deserializeJson(doc, https.getStream());
|
DeserializationError jsonError = deserializeJson(doc, https.getStream());
|
||||||
|
|
||||||
if (!jsonError) {
|
if (!jsonError)
|
||||||
|
{
|
||||||
_latestVersion = doc["tag_name"];
|
_latestVersion = doc["tag_name"];
|
||||||
publishString(_maintenancePathPrefix, mqtt_topic_info_nuki_hub_latest, _latestVersion);
|
publishString(_maintenancePathPrefix, mqtt_topic_info_nuki_hub_latest, _latestVersion);
|
||||||
|
|
||||||
|
if (_latestVersion != _preferences->getString(preference_latest_version).c_str())
|
||||||
|
{
|
||||||
|
_preferences->putString(preference_latest_version, _latestVersion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -669,11 +676,6 @@ 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();
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ 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;
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ void NukiWrapper::initialize(const bool& firstStart)
|
|||||||
_nukiLock.registerBleScanner(_bleScanner);
|
_nukiLock.registerBleScanner(_bleScanner);
|
||||||
|
|
||||||
_intervalLockstate = _preferences->getInt(preference_query_interval_lockstate);
|
_intervalLockstate = _preferences->getInt(preference_query_interval_lockstate);
|
||||||
_intervalConfig = _preferences->getInt(preference_query_interval_battery);
|
_intervalConfig = _preferences->getInt(preference_query_interval_configuration);
|
||||||
_intervalBattery = _preferences->getInt(preference_query_interval_battery);
|
_intervalBattery = _preferences->getInt(preference_query_interval_battery);
|
||||||
_intervalKeypad = _preferences->getInt(preference_query_interval_keypad);
|
_intervalKeypad = _preferences->getInt(preference_query_interval_keypad);
|
||||||
_keypadEnabled = _preferences->getBool(preference_keypad_control_enabled);
|
_keypadEnabled = _preferences->getBool(preference_keypad_control_enabled);
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
#define preference_has_mac_byte_0 "macb0"
|
#define preference_has_mac_byte_0 "macb0"
|
||||||
#define preference_has_mac_byte_1 "macb1"
|
#define preference_has_mac_byte_1 "macb1"
|
||||||
#define preference_has_mac_byte_2 "macb2"
|
#define preference_has_mac_byte_2 "macb2"
|
||||||
|
#define preference_latest_version "latest"
|
||||||
|
|
||||||
class DebugPreferences
|
class DebugPreferences
|
||||||
{
|
{
|
||||||
@@ -78,7 +79,7 @@ private:
|
|||||||
preference_register_as_app, preference_command_nr_of_retries,
|
preference_register_as_app, preference_command_nr_of_retries,
|
||||||
preference_command_retry_delay, preference_cred_user, preference_cred_password, preference_publish_authdata,
|
preference_command_retry_delay, preference_cred_user, preference_cred_password, preference_publish_authdata,
|
||||||
preference_publish_debug_info, preference_presence_detection_timeout,
|
preference_publish_debug_info, preference_presence_detection_timeout,
|
||||||
preference_has_mac_saved, preference_has_mac_byte_0, preference_has_mac_byte_1, preference_has_mac_byte_2,
|
preference_has_mac_saved, preference_has_mac_byte_0, preference_has_mac_byte_1, preference_has_mac_byte_2, preference_latest_version,
|
||||||
};
|
};
|
||||||
std::vector<char*> _redact =
|
std::vector<char*> _redact =
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -636,12 +636,10 @@ void WebCfgServer::buildHtml(String& response)
|
|||||||
}
|
}
|
||||||
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(_preferences->getBool(preference_check_updates))
|
||||||
{
|
{
|
||||||
//if(atof(_latestVersion) > atof(NUKI_HUB_VERSION) || (atof(_latestVersion) == atof(NUKI_HUB_VERSION) && _latestVersion != NUKI_HUB_VERSION)) {
|
//if(atof(_latestVersion) > atof(NUKI_HUB_VERSION) || (atof(_latestVersion) == atof(NUKI_HUB_VERSION) && _latestVersion != NUKI_HUB_VERSION)) {
|
||||||
printParameter(response, "Latest Firmware", _latestVersion, "/ota");
|
printParameter(response, "Latest Firmware", _preferences->getString(preference_latest_version).c_str(), "/ota");
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user