added all devices - API: HTTP read/write #506

This commit is contained in:
proddy
2020-09-20 15:52:44 +02:00
parent 22fcff6682
commit 9fc15650a2
35 changed files with 742 additions and 425 deletions

View File

@@ -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);