mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
publish ha command
This commit is contained in:
@@ -121,12 +121,17 @@ void EMSESPShell::add_console_commands() {
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(publish)},
|
||||
[&](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
shell.printfln(F("Publishing all data to MQTT"));
|
||||
EMSESP::publish_all();
|
||||
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)},
|
||||
|
||||
Reference in New Issue
Block a user