mirror of https://github.com/arendst/Tasmota.git
Merge pull request #5547 from Staars/development
always check for vars_events and mems_events
This commit is contained in:
commit
2c227b8f75
|
@ -486,23 +486,25 @@ void RulesEvery50ms(void)
|
|||
event_data[0] ='\0';
|
||||
}
|
||||
}
|
||||
else if (vars_event) {
|
||||
for (uint8_t i = 0; i < MAX_RULE_VARS-1; i++) {
|
||||
if (bitRead(vars_event, i)) {
|
||||
bitClear(vars_event, i);
|
||||
snprintf_P(json_event, sizeof(json_event), PSTR("{\"Var%d\":{\"State\":%s}}"), i+1, vars[i]);
|
||||
RulesProcessEvent(json_event);
|
||||
break;
|
||||
else if (vars_event || mems_event){
|
||||
if (vars_event) {
|
||||
for (uint8_t i = 0; i < MAX_RULE_VARS-1; i++) {
|
||||
if (bitRead(vars_event, i)) {
|
||||
bitClear(vars_event, i);
|
||||
snprintf_P(json_event, sizeof(json_event), PSTR("{\"Var%d\":{\"State\":%s}}"), i+1, vars[i]);
|
||||
RulesProcessEvent(json_event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mems_event) {
|
||||
for (uint8_t i = 0; i < MAX_RULE_MEMS-1; i++) {
|
||||
if (bitRead(mems_event, i)) {
|
||||
bitClear(mems_event, i);
|
||||
snprintf_P(json_event, sizeof(json_event), PSTR("{\"Mem%d\":{\"State\":%s}}"), i+1, Settings.mems[i]);
|
||||
RulesProcessEvent(json_event);
|
||||
break;
|
||||
if (mems_event) {
|
||||
for (uint8_t i = 0; i < MAX_RULE_MEMS-1; i++) {
|
||||
if (bitRead(mems_event, i)) {
|
||||
bitClear(mems_event, i);
|
||||
snprintf_P(json_event, sizeof(json_event), PSTR("{\"Mem%d\":{\"State\":%s}}"), i+1, Settings.mems[i]);
|
||||
RulesProcessEvent(json_event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1275,4 +1277,4 @@ bool Xdrv10(uint8_t function)
|
|||
return result;
|
||||
}
|
||||
|
||||
#endif // USE_RULES
|
||||
#endif // USE_RULES
|
Loading…
Reference in New Issue