forked from xiaozhi/xiaozhi-esp32
ml307: Add sleep mode (#826)
This commit is contained in:
12
main/ota.cc
12
main/ota.cc
@@ -148,6 +148,10 @@ bool Ota::CheckVersion() {
|
||||
if (settings.GetString(item->string) != item->valuestring) {
|
||||
settings.SetString(item->string, item->valuestring);
|
||||
}
|
||||
} else if (cJSON_IsNumber(item)) {
|
||||
if (settings.GetInt(item->string) != item->valueint) {
|
||||
settings.SetInt(item->string, item->valueint);
|
||||
}
|
||||
}
|
||||
}
|
||||
has_mqtt_config_ = true;
|
||||
@@ -162,9 +166,13 @@ bool Ota::CheckVersion() {
|
||||
cJSON *item = NULL;
|
||||
cJSON_ArrayForEach(item, websocket) {
|
||||
if (cJSON_IsString(item)) {
|
||||
settings.SetString(item->string, item->valuestring);
|
||||
if (settings.GetString(item->string) != item->valuestring) {
|
||||
settings.SetString(item->string, item->valuestring);
|
||||
}
|
||||
} else if (cJSON_IsNumber(item)) {
|
||||
settings.SetInt(item->string, item->valueint);
|
||||
if (settings.GetInt(item->string) != item->valueint) {
|
||||
settings.SetInt(item->string, item->valueint);
|
||||
}
|
||||
}
|
||||
}
|
||||
has_websocket_config_ = true;
|
||||
|
||||
Reference in New Issue
Block a user