From 34f6b412f688db605cfb22bef27d218a4048ca19 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sat, 31 Dec 2022 11:04:24 +0100 Subject: [PATCH] fix #841, `call hcx` show info --- src/console.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/console.cpp b/src/console.cpp index a9486facf..bd151d165 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -364,11 +364,15 @@ void EMSESPShell::add_console_commands() { uint8_t return_code = CommandRet::OK; JsonObject json = doc.to(); + if (cmd == nullptr) { + cmd = device_type == EMSdevice::DeviceType::SYSTEM ? F_(info) : F_(values); + } + if (arguments.size() == 2) { // no value specified, just the cmd return_code = Command::call(device_type, cmd, nullptr, true, id, json); } else if (arguments.size() == 3) { - if (strncmp(cmd, "info", 4) == 0) { + if (strncmp(cmd, F_(info), 4) == 0 || strncmp(cmd, F_(values), 6) == 0) { // info has a id but no value return_code = Command::call(device_type, cmd, nullptr, true, atoi(arguments.back().c_str()), json); } else if (arguments[2] == "?") {