From 0d0d0aa111a200f929f4dbe8ae4d53e6e60c765c Mon Sep 17 00:00:00 2001 From: proddy Date: Tue, 23 Jul 2024 18:54:17 +0200 Subject: [PATCH] show attribute in log message --- src/analogsensor.cpp | 2 +- src/emsdevice.cpp | 5 +---- src/temperaturesensor.cpp | 2 +- src/web/WebCustomEntityService.cpp | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/analogsensor.cpp b/src/analogsensor.cpp index 39902f7f1..c07135672 100644 --- a/src/analogsensor.cpp +++ b/src/analogsensor.cpp @@ -705,7 +705,7 @@ bool AnalogSensor::get_value_info(JsonObject output, const char * cmd, const int output["api_data"] = data; // always as a string return true; } - return EMSESP::return_not_found(output, "attribute", sensor_name); // not found + return EMSESP::return_not_found(output, attribute_s, sensor_name); // not found } return true; // found a match, exit } diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index d2f255ef2..b3d65fdd5 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -1598,16 +1598,13 @@ bool EMSdevice::get_value_info(JsonObject output, const char * cmd, const int8_t // if we're filtering on an attribute, go find it if (attribute_s) { -#if defined(EMSESP_DEBUG) - EMSESP::logger().debug("[DEBUG] fetching single attribute %s", attribute_s); -#endif if (json.containsKey(attribute_s)) { std::string data = json[attribute_s].as(); output.clear(); output["api_data"] = data; // always as string return true; } - return EMSESP::return_not_found(output, "attribute", command_s); // not found + return EMSESP::return_not_found(output, attribute_s, command_s); // not found } return true; diff --git a/src/temperaturesensor.cpp b/src/temperaturesensor.cpp index 6919cc054..d94ce1255 100644 --- a/src/temperaturesensor.cpp +++ b/src/temperaturesensor.cpp @@ -402,7 +402,7 @@ bool TemperatureSensor::get_value_info(JsonObject output, const char * cmd, cons output["api_data"] = data; // always as string return true; } - return EMSESP::return_not_found(output, "attribute", sensor_name); // not found + return EMSESP::return_not_found(output, attribute_s, sensor_name); // not found } return true; // found a match, exit } diff --git a/src/web/WebCustomEntityService.cpp b/src/web/WebCustomEntityService.cpp index 612f86b64..94f538861 100644 --- a/src/web/WebCustomEntityService.cpp +++ b/src/web/WebCustomEntityService.cpp @@ -325,7 +325,7 @@ bool WebCustomEntityService::get_value_info(JsonObject output, const char * cmd) output["api_data"] = data; // always as string return true; } - return EMSESP::return_not_found(output, "attribute", command_s); // not found + return EMSESP::return_not_found(output, attribute_s, command_s); // not found } }