mirror of https://github.com/arendst/Tasmota.git
Save some bytes
This commit is contained in:
parent
744b83dae2
commit
6b05b62099
|
@ -913,10 +913,8 @@ void RulesEvery50ms(void)
|
||||||
} else {
|
} else {
|
||||||
parameter = event + strlen(event); // '\0'
|
parameter = event + strlen(event); // '\0'
|
||||||
}
|
}
|
||||||
if (parameter[0]=='{')
|
bool quotes = (parameter[0] != '{');
|
||||||
snprintf_P(json_event, sizeof(json_event), PSTR("{\"Event\":{\"%s\":%s}}"), event, parameter);
|
snprintf_P(json_event, sizeof(json_event), PSTR("{\"Event\":{\"%s\":%s%s%s}}"), event, (quotes)?"\"":"", parameter, (quotes)?"\"":"");
|
||||||
else
|
|
||||||
snprintf_P(json_event, sizeof(json_event), PSTR("{\"Event\":{\"%s\":\"%s\"}}"), event, parameter);
|
|
||||||
Rules.event_data[0] ='\0';
|
Rules.event_data[0] ='\0';
|
||||||
RulesProcessEvent(json_event);
|
RulesProcessEvent(json_event);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue