Fix rule Invalid JSON message

This commit is contained in:
Theo Arends 2021-05-04 11:10:24 +02:00
parent 08502aafa9
commit 90bb707430

View File

@ -508,10 +508,11 @@ bool RulesRuleMatch(uint8_t rule_set, String &event, String &rule, bool stop_all
rule_name = rule_name.substring(0, pos); // "SUBTYPE1#CURRENT" rule_name = rule_name.substring(0, pos); // "SUBTYPE1#CURRENT"
} }
String buf = event; // copy the string into a new buffer that will be modified String buf = event; // Copy the string into a new buffer that will be modified
//AddLog_P(LOG_LEVEL_DEBUG, PSTR("RUL-RM2: RulesRuleMatch |%s|"), buf.c_str()); //AddLog_P(LOG_LEVEL_DEBUG, PSTR("RUL-RM2: RulesRuleMatch |%s|"), buf.c_str());
buf.replace("\\"," "); // "Disable" any escaped control character
JsonParser parser((char*)buf.c_str()); JsonParser parser((char*)buf.c_str());
JsonParserObject obj = parser.getRootObject(); JsonParserObject obj = parser.getRootObject();
if (!obj) { if (!obj) {