Cleaning and optimization

This commit is contained in:
Dmitry Borisenko
2020-11-19 04:14:52 +03:00
parent 4f9763334b
commit 70c34d3d8d
15 changed files with 29 additions and 978 deletions

View File

@@ -94,7 +94,7 @@ void csvCmdExecute(String& cmdStr) {
else if (order == F("count-down")) {
sCmd.addCommand(order.c_str(), countDown);
}
sCmd.readStr(buf);
}
cmdStr = deleteBeforeDelimiter(cmdStr, "\n");
@@ -163,3 +163,20 @@ int getKeyNum(String& key, String& keyNumberTable) {
}
return number;
}
String getValue(String& key) {
String live = jsonReadStr(configLiveJson, key);
String store = jsonReadStr(configStoreJson, key);
if (live != nullptr) {
return live;
}
else if (store != nullptr) {
return store;
}
else if (store == nullptr && live == nullptr) {
return "no value";
}
else {
return "data error";
}
}