mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
added all devices - API: HTTP read/write #506
This commit is contained in:
@@ -153,7 +153,7 @@ void EMSESPShell::add_console_commands() {
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(show), F_(commands)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) { Command::show_all_commands(shell); });
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) { Command::show_all(shell); });
|
||||
|
||||
commands->add_command(
|
||||
ShellContext::MAIN,
|
||||
@@ -466,8 +466,10 @@ void Console::load_standard_commands(unsigned int context) {
|
||||
|
||||
|
||||
// load the commands (console & mqtt topics) for this specific context
|
||||
Command::add_context_commands(context);
|
||||
|
||||
// unless it's main (the root)
|
||||
if (context != ShellContext::MAIN) {
|
||||
Command::add_context_commands(context);
|
||||
}
|
||||
}
|
||||
|
||||
// prompt, change per context
|
||||
@@ -485,6 +487,9 @@ std::string EMSESPShell::context_text() {
|
||||
case ShellContext::THERMOSTAT:
|
||||
return std::string{"/thermostat"};
|
||||
|
||||
case ShellContext::SENSOR:
|
||||
return std::string{"/sensor"};
|
||||
|
||||
default:
|
||||
return std::string{};
|
||||
}
|
||||
@@ -577,7 +582,6 @@ void Console::start() {
|
||||
shell->log_level(uuid::log::Level::DEBUG);
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(EMSESP_STANDALONE)
|
||||
// always start in su/admin mode when running tests
|
||||
shell->add_flags(CommandFlags::ADMIN);
|
||||
|
||||
Reference in New Issue
Block a user