diff --git a/src/command.cpp b/src/command.cpp index deb5fcc3a..03456ca95 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -189,7 +189,7 @@ void Command::add(const uint8_t device_type, const __FlashStringHelper * cmd, cm // add a command to the list, which does return a json object as output // flag is fixed to MqttSubFlag::FLAG_NOSUB -void Command::add_returns_json(const uint8_t device_type, +void Command::add_json(const uint8_t device_type, const __FlashStringHelper * cmd, cmdfunction_json_p cb, const __FlashStringHelper * description, diff --git a/src/command.h b/src/command.h index 653758ff7..e7df2e672 100644 --- a/src/command.h +++ b/src/command.h @@ -109,7 +109,7 @@ class Command { const __FlashStringHelper * description, uint8_t flags = CommandFlag::MQTT_SUB_FLAG_NORMAL); - static void add_returns_json(const uint8_t device_type, + static void add_json(const uint8_t device_type, const __FlashStringHelper * cmd, cmdfunction_json_p cb, const __FlashStringHelper * description, diff --git a/src/dallassensor.cpp b/src/dallassensor.cpp index a7659acf3..c1ebc8574 100644 --- a/src/dallassensor.cpp +++ b/src/dallassensor.cpp @@ -41,12 +41,12 @@ void DallasSensor::start() { bus_.begin(dallas_gpio_); #endif // API calls - Command::add_returns_json( + Command::add_json( EMSdevice::DeviceType::DALLASSENSOR, F_(info), [&](const char * value, const int8_t id, JsonObject & json) { return command_info(value, id, json); }, F_(info_cmd)); - Command::add_returns_json( + Command::add_json( EMSdevice::DeviceType::DALLASSENSOR, F_(commands), [&](const char * value, const int8_t id, JsonObject & json) { return command_commands(value, id, json); }, diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 46a44a18e..6eb36ab0e 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -986,18 +986,18 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, std:: return true; } - Command::add_returns_json( + Command::add_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_returns_json( + Command::add_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, CommandFlag::HIDDEN); // this command is hidden - Command::add_returns_json( + Command::add_json( device_type, F_(commands), [device_type](const char * value, const int8_t id, JsonObject & json) { return command_commands(device_type, json, id); },