mirror of https://github.com/arendst/Tasmota.git
Merge pull request #12496 from barbudor/event_json
EVENT support JSON payload
This commit is contained in:
commit
744b83dae2
|
@ -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