This commit is contained in:
@@ -39,15 +39,18 @@ Firmware OTA::getLatestVersionOnServer() {
|
|||||||
|
|
||||||
std::vector<Configuration> configs;
|
std::vector<Configuration> configs;
|
||||||
for (JsonObject config : doc["Configurations"].as<JsonArray>()) {
|
for (JsonObject config : doc["Configurations"].as<JsonArray>()) {
|
||||||
if (config.containsKey("Version") && config.containsKey("URL")) {
|
if (config.containsKey("Version") && config.containsKey("URL") && config.containsKey("Configuration")) {
|
||||||
|
String deviceConfig = config["Configuration"].as<String>();
|
||||||
|
if (deviceConfig == _current_device_configuration) {
|
||||||
configs.push_back(Configuration{
|
configs.push_back(Configuration{
|
||||||
parseVersion(config["Version"]),
|
parseVersion(config["Version"]),
|
||||||
config["URL"],
|
config["URL"],
|
||||||
config["Board"],
|
config["Board"],
|
||||||
config["Configuration"]
|
deviceConfig
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (configs.empty()) {
|
if (configs.empty()) {
|
||||||
return createErrorResponse("No valid configuration found in the JSON response");
|
return createErrorResponse("No valid configuration found in the JSON response");
|
||||||
|
|||||||
@@ -7,6 +7,6 @@
|
|||||||
#define water_level_min_key "water_level_min"
|
#define water_level_min_key "water_level_min"
|
||||||
#define water_level_max_key "water_level_max"
|
#define water_level_max_key "water_level_max"
|
||||||
#define water_volume_key "water_volume"
|
#define water_volume_key "water_volume"
|
||||||
#define current_software_version Version{0, 0, 5}
|
#define current_software_version Version{0, 0, 6}
|
||||||
|
|
||||||
#define RESISTOR_VALUE 4
|
#define RESISTOR_VALUE 4
|
||||||
Reference in New Issue
Block a user