only print API json when there is one after a call command

This commit is contained in:
proddy
2020-09-26 08:22:36 +02:00
parent 3e66696ef5
commit 8676feaebb

View File

@@ -397,11 +397,9 @@ void EMSESPShell::add_console_commands() {
ok = Command::call(device_type, cmd, arguments[2].c_str(), atoi(arguments[3].c_str()), output); ok = Command::call(device_type, cmd, arguments[2].c_str(), atoi(arguments[3].c_str()), output);
} }
if (ok) { if (ok && output.size()) {
shell.print(F("output: "));
serializeJson(doc, shell); serializeJson(doc, shell);
shell.println(); shell.println();
shell.println();
} }
}, },
[&](Shell & shell __attribute__((unused)), const std::vector<std::string> & arguments) -> std::vector<std::string> { [&](Shell & shell __attribute__((unused)), const std::vector<std::string> & arguments) -> std::vector<std::string> {