This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
#include <ArduinoLog.h>
|
||||
#include <HTTPUpdate.h>
|
||||
|
||||
OTA::OTA(String server_url, String currentVersion, String currentDeviceConfiguration) {
|
||||
OTA::OTA(String server_url, Version currentVersion, String currentDeviceConfiguration) {
|
||||
_serverUrl = server_url;
|
||||
_currentVersion = parseVersion(currentVersion.c_str());
|
||||
_currentVersion = currentVersion;
|
||||
_current_device_configuration = currentDeviceConfiguration;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,13 @@ Firmware OTA::getLatestVersionOnServer() {
|
||||
return createErrorResponse("No valid configuration found in the JSON response");
|
||||
}
|
||||
|
||||
|
||||
Configuration latest = getLatestConfiguration(configs.data(), configs.size());
|
||||
|
||||
if (!isVersionNewer(_currentVersion, latest.version)) {
|
||||
Log.verbose("No newer version found. Server version: %d.%d.%d", latest.version.major, latest.version.minor, latest.version.patch);
|
||||
}
|
||||
|
||||
return Firmware{
|
||||
latest.version,
|
||||
latest.url,
|
||||
|
||||
Reference in New Issue
Block a user