show device name in debug

This commit is contained in:
proddy
2021-04-06 18:38:31 +02:00
parent 060802c8f1
commit 11bdff9132

View File

@@ -55,14 +55,15 @@ bool Command::call(const uint8_t device_type, const char * cmd, const char * val
// id may be used to represent a heating circuit for example // id may be used to represent a heating circuit for example
// returns false if error or not found // returns false if error or not found
bool Command::call(const uint8_t device_type, const char * cmd, const char * value, const int8_t id, JsonObject & json) { bool Command::call(const uint8_t device_type, const char * cmd, const char * value, const int8_t id, JsonObject & json) {
std::string dname = EMSdevice::device_type_2_device_name(device_type);
auto cf = find_command(device_type, cmd); auto cf = find_command(device_type, cmd);
if (cf == nullptr) { if (cf == nullptr) {
LOG_WARNING(F("Command %s not found"), cmd); LOG_WARNING(F("Command %s on %s not found"), cmd, dname.c_str());
return false; // command not found or not json return false; // command not found or not json
} }
#ifdef EMSESP_DEBUG #ifdef EMSESP_DEBUG
std::string dname = EMSdevice::device_type_2_device_name(device_type);
if (value == nullptr) { if (value == nullptr) {
LOG_DEBUG(F("[DEBUG] Calling %s command %s"), dname.c_str(), cmd); LOG_DEBUG(F("[DEBUG] Calling %s command %s"), dname.c_str(), cmd);
} else if (id == -1) { } else if (id == -1) {