allow disabling Tasmota JSON API (#1236)

* allow disabling Tasmota JSON API

* test enable
This commit is contained in:
openshwprojects
2024-05-14 11:53:26 +02:00
committed by GitHub
parent 7a7ad1eba0
commit c11a8d1e55
6 changed files with 29 additions and 3 deletions

View File

@ -2062,7 +2062,9 @@ static int http_rest_post_cmd(http_request_t* request) {
request->responseCode = code;
http_setup(request, httpMimeTypeJson);
hprintf255(request, "{\"%s\":%d, \"msg\":\"%s\", \"res\":", type, code, reply);
#if ENABLE_TASMOTA_JSON
JSON_ProcessCommandReply(cmd, skipToNextWord(cmd), request, (jsonCb_t)hprintf255, COMMAND_FLAG_SOURCE_HTTP);
#endif
hprintf255(request, "}", code, reply);
poststr(request, NULL);
return 0;