split out commands with and without json

This commit is contained in:
proddy
2020-11-23 13:13:59 +01:00
parent 3e86a48e2b
commit cd016ae639
3 changed files with 54 additions and 36 deletions

View File

@@ -52,7 +52,7 @@ void WebAPIService::webAPIService(AsyncWebServerRequest * request) {
String cmd = request->getParam(F_(cmd))->value();
// look up command in our list
if (!Command::find_command(device_type, cmd.c_str())) {
if (Command::find_command(device_type, cmd.c_str()) == nullptr) {
request->send(400, "text/plain", F("Invalid cmd"));
return;
}