Command uses flash fullname instead of custom, to save on heap

This commit is contained in:
Proddy
2022-09-10 17:18:43 +02:00
parent 4cd655fb36
commit cc44bc9d7f
9 changed files with 42 additions and 58 deletions

View File

@@ -1052,25 +1052,25 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
[device_type](const char * value, const int8_t id, JsonObject & output) {
return command_info(device_type, output, id, EMSdevice::OUTPUT_TARGET::API_VERBOSE);
},
uuid::read_flash_string(F_(info_cmd)));
F_(info_cmd));
Command::add(
device_type,
F("values"),
[device_type](const char * value, const int8_t id, JsonObject & output) {
return command_info(device_type, output, id, EMSdevice::OUTPUT_TARGET::API_SHORTNAMES); // HIDDEN command showing short names, used in e.g. /api/boiler
},
"",
nullptr,
CommandFlag::HIDDEN); // this command is hidden
Command::add(
device_type,
F_(commands),
[device_type](const char * value, const int8_t id, JsonObject & output) { return command_commands(device_type, output, id); },
uuid::read_flash_string(F_(commands_cmd)));
F_(commands_cmd));
Command::add(
device_type,
F_(entities),
[device_type](const char * value, const int8_t id, JsonObject & output) { return command_entities(device_type, output, id); },
uuid::read_flash_string(F_(entities_cmd)));
F_(entities_cmd));
// MQTT subscribe to the device e.g. "ems-esp/boiler/#"
Mqtt::subscribe(device_type, EMSdevice::device_type_2_device_name(device_type) + "/#", nullptr);