mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-27 17:19:08 +03:00
commands "fetch" and "publish ha" as call (#608)
This commit is contained in:
@@ -108,28 +108,6 @@ void EMSESPShell::add_console_commands() {
|
||||
// commands->remove_context_commands(ShellContext::MAIN);
|
||||
commands->remove_all_commands();
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(fetch)},
|
||||
[&](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
shell.printfln(F("Requesting data from EMS devices"));
|
||||
EMSESP::fetch_device_values();
|
||||
});
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(publish)},
|
||||
flash_string_vector{F_(ha_optional)},
|
||||
[&](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
if (arguments.empty()) {
|
||||
EMSESP::publish_all();
|
||||
shell.printfln(F("Published all data to MQTT"));
|
||||
} else {
|
||||
EMSESP::publish_all(true);
|
||||
shell.printfln(F("Published all data to MQTT, including HA configs"));
|
||||
}
|
||||
});
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(show)},
|
||||
@@ -312,14 +290,6 @@ void EMSESPShell::add_console_commands() {
|
||||
});
|
||||
#endif
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(send), F_(telegram)},
|
||||
flash_string_vector{F_(data_mandatory)},
|
||||
[](Shell & shell __attribute__((unused)), const std::vector<std::string> & arguments) {
|
||||
EMSESP::send_raw_telegram(arguments.front().c_str());
|
||||
});
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(watch)},
|
||||
|
||||
Reference in New Issue
Block a user