From 8be5631394d65966af12b6eef034df65e6cc390f Mon Sep 17 00:00:00 2001 From: iranl Date: Wed, 7 Feb 2024 22:41:13 +0100 Subject: [PATCH] Show latest version on WebCfg --- Network.cpp | 5 +++++ Network.h | 1 + WebCfgServer.cpp | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/Network.cpp b/Network.cpp index c122c0b..0926257 100644 --- a/Network.cpp +++ b/Network.cpp @@ -663,6 +663,11 @@ int Network::mqttConnectionState() return _mqttConnectionState; } +String Network::latestHubVersion() +{ + return _latestVersion; +} + bool Network::encryptionSupported() { return _device->supportsEncryption(); diff --git a/Network.h b/Network.h index 3a5012f..46e367d 100644 --- a/Network.h +++ b/Network.h @@ -63,6 +63,7 @@ public: void publishPresenceDetection(char* csv); int mqttConnectionState(); // 0 = not connected; 1 = connected; 2 = connected and mqtt processed + String latestHubVersion(); bool encryptionSupported(); const String networkDeviceName() const; diff --git a/WebCfgServer.cpp b/WebCfgServer.cpp index 07f1446..2416b8b 100644 --- a/WebCfgServer.cpp +++ b/WebCfgServer.cpp @@ -612,6 +612,13 @@ void WebCfgServer::buildHtml(String& response) printParameter(response, "NUKI Opener state", lockstateArr); } printParameter(response, "Firmware", version.c_str(), "/info"); + + String _latestVersion = _network->latestHubVersion(); + + //if (_latestVersion.toFloat() > atof(NUKI_HUB_VERSION) || (_latestVersion.toFloat() == atof(NUKI_HUB_VERSION) && _latestVersion.c_str() != NUKI_HUB_VERSION)) { + printParameter(response, "Latest Firmware", _latestVersion.c_str(), GITHUB_LATEST_RELEASE_URL); + //} + response.concat("

"); response.concat("

MQTT and Network Configuration

");