mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-15 08:56:34 +02:00
Fix: Configuratoin failed response mesasge and failed condition handle.
This commit is contained in:
@ -411,6 +411,7 @@ bool Configuration::parse(String data, bool isLocal) {
|
|||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
failedMessage =
|
||||||
jsonValueInvalidMessage(String(jprop_displayMode), mode);
|
jsonValueInvalidMessage(String(jprop_displayMode), mode);
|
||||||
jsonInvalid();
|
jsonInvalid();
|
||||||
return false;
|
return false;
|
||||||
@ -503,11 +504,17 @@ bool Configuration::parse(String data, bool isLocal) {
|
|||||||
if (JSON.typeof_(root[jprop_mqttBrokerUrl]) == "string") {
|
if (JSON.typeof_(root[jprop_mqttBrokerUrl]) == "string") {
|
||||||
String broker = root[jprop_mqttBrokerUrl];
|
String broker = root[jprop_mqttBrokerUrl];
|
||||||
String oldBroker = jconfig[jprop_mqttBrokerUrl];
|
String oldBroker = jconfig[jprop_mqttBrokerUrl];
|
||||||
|
if (broker.length() <= 255) {
|
||||||
if (broker != oldBroker) {
|
if (broker != oldBroker) {
|
||||||
changed = true;
|
changed = true;
|
||||||
configLogInfo(String(jprop_mqttBrokerUrl), oldBroker, broker);
|
configLogInfo(String(jprop_mqttBrokerUrl), oldBroker, broker);
|
||||||
jconfig[jprop_mqttBrokerUrl] = broker;
|
jconfig[jprop_mqttBrokerUrl] = broker;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
failedMessage = "\"mqttBrokerUrl\" length should <= 255";
|
||||||
|
jsonInvalid();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (jsonTypeInvalid(root[jprop_mqttBrokerUrl], "string")) {
|
if (jsonTypeInvalid(root[jprop_mqttBrokerUrl], "string")) {
|
||||||
failedMessage =
|
failedMessage =
|
||||||
@ -528,7 +535,7 @@ bool Configuration::parse(String data, bool isLocal) {
|
|||||||
configLogInfo(String(jprop_temperatureUnit), oldUnit, unit);
|
configLogInfo(String(jprop_temperatureUnit), oldUnit, unit);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
jsonValueInvalidMessage(String(jprop_temperatureUnit), unit);
|
failedMessage = jsonValueInvalidMessage(String(jprop_temperatureUnit), unit);
|
||||||
jsonInvalid();
|
jsonInvalid();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user