one command function, to save on heap

This commit is contained in:
proddy
2026-06-10 22:06:46 +02:00
parent 5357f633d3
commit 7664d50d69
11 changed files with 62 additions and 60 deletions

View File

@@ -197,7 +197,7 @@ StateUpdateResult WebCommands::update(JsonObject root, WebCommands & webCommands
Command::add(
EMSdevice::DeviceType::COMMAND,
webCommands.commandItems.back().name,
[name = std::string(webCommands.commandItems.back().name)](const char * value, const int8_t id) {
[name = std::string(webCommands.commandItems.back().name)](const char * value, const int8_t id, JsonObject output) {
return EMSESP::webCommandService.dispatchCommand(name.c_str(), value); // value is optional
},
FL_(command_cmd),
@@ -442,7 +442,7 @@ void WebCommandService::load_test_data() {
Command::add(
EMSdevice::DeviceType::COMMAND,
item.name,
[name = std::string(item.name)](const char * value, const int8_t id) {
[name = std::string(item.name)](const char * value, const int8_t id, JsonObject output) {
return EMSESP::webCommandService.dispatchCommand(name.c_str(), value);
},
FL_(command_cmd),