mirror of https://github.com/arendst/Tasmota.git
event support JSON payload
This commit is contained in:
parent
80f18a53e1
commit
51744bf645
|
@ -913,7 +913,10 @@ void RulesEvery50ms(void)
|
|||
} else {
|
||||
parameter = event + strlen(event); // '\0'
|
||||
}
|
||||
snprintf_P(json_event, sizeof(json_event), PSTR("{\"Event\":{\"%s\":\"%s\"}}"), event, parameter);
|
||||
if (parameter[0]=='{')
|
||||
snprintf_P(json_event, sizeof(json_event), PSTR("{\"Event\":{\"%s\":%s}}"), event, parameter);
|
||||
else
|
||||
snprintf_P(json_event, sizeof(json_event), PSTR("{\"Event\":{\"%s\":\"%s\"}}"), event, parameter);
|
||||
Rules.event_data[0] ='\0';
|
||||
RulesProcessEvent(json_event);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue