show commands has a verbose mode

This commit is contained in:
proddy
2021-05-09 10:59:03 +02:00
parent 81f4724d71
commit 0e67e8311e

View File

@@ -256,7 +256,7 @@ void EMSESPShell::add_console_commands() {
uint16_t offset = Helpers::hextoint(arguments.back().c_str());
EMSESP::send_read_request(type_id, device_id, offset, EMS_MAX_TELEGRAM_LENGTH);
} else {
// send with length to send immediatly and trigger publish read_id
// send with length to send immediately and trigger publish read_id
EMSESP::send_read_request(type_id, device_id, 0, EMS_MAX_TELEGRAM_LENGTH);
}
});
@@ -375,8 +375,8 @@ void EMSESPShell::add_console_commands() {
// validate the command
if (arguments.size() < 2) {
shell.print(F("Available commands are: "));
Command::show(shell, device_type);
shell.print(F("Missing command. Available commands are: "));
Command::show(shell, device_type, false); // non-verbose mode
return;
}
@@ -403,14 +403,13 @@ void EMSESPShell::add_console_commands() {
}
if (ok && json.size()) {
doc.shrinkToFit();
serializeJsonPretty(doc, shell);
shell.println();
return;
} else if (!ok) {
shell.println(F("Unknown command, value, or id."));
shell.print(F("Available commands are: "));
Command::show(shell, device_type);
Command::show(shell, device_type, false); // non-verbose mode
}
},
[&](Shell & shell __attribute__((unused)), const std::vector<std::string> & arguments) -> std::vector<std::string> {