refactor out console context menus - #510

This commit is contained in:
proddy
2020-09-23 00:19:51 +02:00
parent 6763bb2832
commit b1f10fa5ee
33 changed files with 295 additions and 489 deletions

View File

@@ -157,9 +157,9 @@ void System::start() {
// these commands respond to the topic "system" and take a payload like {cmd:"", data:"", id:""}
EMSESP::emsespSettingsService.read([&](EMSESPSettings & settings) {
Command::add(EMSdevice::DeviceType::SERVICEKEY, settings.ems_bus_id, F("pin"), System::command_pin);
Command::add(EMSdevice::DeviceType::SERVICEKEY, settings.ems_bus_id, F("send"), System::command_send);
Command::add_with_json(EMSdevice::DeviceType::SERVICEKEY, F("info"), System::command_info);
Command::add(EMSdevice::DeviceType::SYSTEM, settings.ems_bus_id, F("pin"), System::command_pin);
Command::add(EMSdevice::DeviceType::SYSTEM, settings.ems_bus_id, F("send"), System::command_send);
Command::add_with_json(EMSdevice::DeviceType::SYSTEM, F("info"), System::command_info);
});
EMSESP::init_tx(); // start UART
@@ -523,7 +523,7 @@ void System::console_commands(Shell & shell, unsigned int context) {
EMSESPShell::commands->add_command(ShellContext::SYSTEM,
CommandFlags::USER,
flash_string_vector{F_(show)},
flash_string_vector{F_(show), F_(system)},
[=](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
show_system(shell);
shell.println();