Merge pull request #5604 from Staars/development

do not forget to handle the last vars_event and mems_event
This commit is contained in:
Theo Arends 2019-04-09 18:40:45 +02:00 committed by GitHub
commit 0dbbf413a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -488,7 +488,7 @@ void RulesEvery50ms(void)
}
else if (vars_event || mems_event){
if (vars_event) {
for (uint8_t i = 0; i < MAX_RULE_VARS-1; i++) {
for (uint8_t i = 0; i < MAX_RULE_VARS; 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]);
@ -498,7 +498,7 @@ void RulesEvery50ms(void)
}
}
if (mems_event) {
for (uint8_t i = 0; i < MAX_RULE_MEMS-1; i++) {
for (uint8_t i = 0; i < MAX_RULE_MEMS; 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]);