Fix mqtt host still exist on local when on server is disabled

This commit is contained in:
samuelbles07
2025-03-31 14:51:53 +07:00
parent 7fbab82088
commit e9be9dcc83

View File

@@ -739,7 +739,13 @@ bool Configuration::parse(String data, bool isLocal) {
jsonInvalid();
return false;
}
} else {
}
else if (JSON.typeof_(root[jprop_mqttBrokerUrl]) == "null" and !isLocal) {
// So if its not available on the json and json comes from aigradient server
// then set its value to default (empty)
jconfig[jprop_mqttBrokerUrl] = jprop_mqttBrokerUrl_default;
}
else {
if (jsonTypeInvalid(root[jprop_mqttBrokerUrl], "string")) {
failedMessage =
jsonTypeInvalidMessage(String(jprop_mqttBrokerUrl), "string");