mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
command default id=-1, command_check, add "warm water" to long names
This commit is contained in:
@@ -373,8 +373,18 @@ void EMSESPShell::add_console_commands() {
|
||||
return;
|
||||
}
|
||||
|
||||
DynamicJsonDocument doc(EMSESP_JSON_SIZE_XLARGE_DYN);
|
||||
JsonObject json = doc.to<JsonObject>();
|
||||
|
||||
bool ok = false;
|
||||
// validate the command
|
||||
if (arguments.size() < 2) {
|
||||
// no cmd specified, default to empty command
|
||||
if (Command::call(device_type, "", "", -1, json)) {
|
||||
serializeJsonPretty(doc, shell);
|
||||
shell.println();
|
||||
return;
|
||||
}
|
||||
shell.print(F("Missing command. Available commands are: "));
|
||||
Command::show(shell, device_type, false); // non-verbose mode
|
||||
return;
|
||||
@@ -382,10 +392,6 @@ void EMSESPShell::add_console_commands() {
|
||||
|
||||
const char * cmd = arguments[1].c_str();
|
||||
|
||||
DynamicJsonDocument doc(EMSESP_JSON_SIZE_XLARGE_DYN);
|
||||
JsonObject json = doc.to<JsonObject>();
|
||||
|
||||
bool ok = false;
|
||||
if (arguments.size() == 2) {
|
||||
// no value specified, just the cmd
|
||||
ok = Command::call(device_type, cmd, nullptr, -1, json);
|
||||
|
||||
Reference in New Issue
Block a user