mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +03:00
added new command called commands
This commit is contained in:
@@ -968,18 +968,31 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, std::
|
||||
return true;
|
||||
}
|
||||
|
||||
Command::add_with_json(device_type, F_(info), [device_type](const char * value, const int8_t id, JsonObject & json) {
|
||||
return command_info(device_type, json, id, true);
|
||||
});
|
||||
Command::add_with_json(
|
||||
device_type,
|
||||
F_(info),
|
||||
[device_type](const char * value, const int8_t id, JsonObject & json) { return command_info(device_type, json, id, true); },
|
||||
F_(info_cmd));
|
||||
Command::add_with_json(
|
||||
device_type,
|
||||
F("info_short"),
|
||||
[device_type](const char * value, const int8_t id, JsonObject & json) { return command_info(device_type, json, id, false); },
|
||||
nullptr,
|
||||
true); // this command is hidden
|
||||
Command::add_with_json(
|
||||
device_type,
|
||||
F_(commands),
|
||||
[device_type](const char * value, const int8_t id, JsonObject & json) { return command_commands(device_type, json, id); },
|
||||
F_(commands_cmd));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// list all available commands, return as json
|
||||
bool EMSESP::command_commands(uint8_t device_type, JsonObject & json, const int8_t id) {
|
||||
return Command::list(device_type, json);
|
||||
}
|
||||
|
||||
// export all values to info command
|
||||
// value is ignored here
|
||||
// info command always shows in verbose mode, so full names are displayed
|
||||
|
||||
Reference in New Issue
Block a user