mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
Optimization
This commit is contained in:
@@ -231,9 +231,6 @@ void publishWidgets() {
|
||||
|
||||
void publishState() {
|
||||
// берет строку json и ключи превращает в топики а значения колючей в них посылает
|
||||
// {"name":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1"}
|
||||
// "name":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1"
|
||||
// "name":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1",
|
||||
String str = configLiveJson;
|
||||
str.replace("{", "");
|
||||
str.replace("}", "");
|
||||
@@ -242,13 +239,13 @@ void publishState() {
|
||||
while (str.length()) {
|
||||
String tmp = selectToMarker(str, ",");
|
||||
|
||||
String topic = selectToMarker(tmp, ":");
|
||||
String topic = selectToMarker(tmp, "\":");
|
||||
topic.replace("\"", "");
|
||||
|
||||
String state = selectToMarkerLast(tmp, ":");
|
||||
String state = selectToMarkerLast(tmp, "\":");
|
||||
state.replace("\"", "");
|
||||
|
||||
if ((topic != "time") && (topic != "name") && (topic != "lang") && (topic != "ip") && (topic.indexOf("_in") < 0)) {
|
||||
if (topic != "timenow") {
|
||||
publishStatus(topic, state);
|
||||
}
|
||||
str = deleteBeforeDelimiter(str, ",");
|
||||
|
||||
Reference in New Issue
Block a user