mirror of https://github.com/arendst/Tasmota.git
Fix rule trigger support for status 11
Fix rule trigger support for status 11 (#9053)
This commit is contained in:
parent
89e7822975
commit
ecd06b6c83
|
@ -497,9 +497,12 @@ bool RulesRuleMatch(uint8_t rule_set, String &event, String &rule)
|
|||
rule_name = rule_name.substring(0, pos); // "SUBTYPE1#CURRENT"
|
||||
}
|
||||
|
||||
StaticJsonBuffer<1024> jsonBuf;
|
||||
StaticJsonBuffer<1280> jsonBuf; // Was 1024 until 20200811
|
||||
JsonObject &root = jsonBuf.parseObject(event);
|
||||
if (!root.success()) { return false; } // No valid JSON data
|
||||
if (!root.success()) {
|
||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("RUL: Event too long (%d)"), event.length());
|
||||
return false;
|
||||
} // No valid JSON data
|
||||
JsonObject *obj = &root;
|
||||
String subtype;
|
||||
uint32_t i = 0;
|
||||
|
@ -512,6 +515,8 @@ bool RulesRuleMatch(uint8_t rule_set, String &event, String &rule)
|
|||
|
||||
rule_name = rule_name.substring(pos +1);
|
||||
if (i++ > 10) { return false; } // Abandon possible loop
|
||||
|
||||
yield();
|
||||
}
|
||||
|
||||
const JsonVariant & val = GetCaseInsensitive(*obj, rule_name.c_str());
|
||||
|
|
Loading…
Reference in New Issue