mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
shell call device/commands show info/values/commands
This commit is contained in:
@@ -561,11 +561,7 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// non EMS devices always have an info, commands and values
|
if (!verbose) {
|
||||||
bool show_info = (device_type == EMSdevice::DeviceType::TEMPERATURESENSOR || device_type == EMSdevice::DeviceType::ANALOGSENSOR
|
|
||||||
|| device_type == EMSdevice::DeviceType::SCHEDULER || device_type == EMSdevice::DeviceType::CUSTOM);
|
|
||||||
|
|
||||||
if (!verbose && show_info) {
|
|
||||||
sorted_cmds.push_back(F_(info));
|
sorted_cmds.push_back(F_(info));
|
||||||
sorted_cmds.push_back(F_(commands));
|
sorted_cmds.push_back(F_(commands));
|
||||||
sorted_cmds.push_back(F_(values));
|
sorted_cmds.push_back(F_(values));
|
||||||
@@ -587,14 +583,12 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo
|
|||||||
shell.printfln("\n%s%s %s:%s", COLOR_BOLD_ON, COLOR_YELLOW, EMSdevice::device_type_2_device_name(device_type), COLOR_RESET);
|
shell.printfln("\n%s%s %s:%s", COLOR_BOLD_ON, COLOR_YELLOW, EMSdevice::device_type_2_device_name(device_type), COLOR_RESET);
|
||||||
|
|
||||||
// we hard code 'info' and 'commands' commands so print them first
|
// we hard code 'info' and 'commands' commands so print them first
|
||||||
if (show_info) {
|
shell.printf(" info \t\t\t\t%slist all values %s*", COLOR_BRIGHT_CYAN, COLOR_BRIGHT_GREEN);
|
||||||
shell.printf(" info:\t\t\t\t%slist all values %s*", COLOR_BRIGHT_CYAN, COLOR_BRIGHT_GREEN);
|
|
||||||
shell.println(COLOR_RESET);
|
shell.println(COLOR_RESET);
|
||||||
shell.printf(" commands:\t\t\t%slist all commands %s*", COLOR_BRIGHT_CYAN, COLOR_BRIGHT_GREEN);
|
shell.printf(" commands \t\t\t%slist all commands %s*", COLOR_BRIGHT_CYAN, COLOR_BRIGHT_GREEN);
|
||||||
shell.println(COLOR_RESET);
|
shell.println(COLOR_RESET);
|
||||||
shell.printf(" values:\t\t\t%slist all values %s*", COLOR_BRIGHT_CYAN, COLOR_BRIGHT_GREEN);
|
shell.printf(" values \t\t\t%slist all values %s*", COLOR_BRIGHT_CYAN, COLOR_BRIGHT_GREEN);
|
||||||
shell.println(COLOR_RESET);
|
shell.println(COLOR_RESET);
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto & cl : sorted_cmds) {
|
for (const auto & cl : sorted_cmds) {
|
||||||
// find and print the description
|
// find and print the description
|
||||||
|
|||||||
Reference in New Issue
Block a user