mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
Cleaning and optimization
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user