This commit is contained in:
MichaelDvP
2022-12-30 19:00:51 +01:00
parent 275ac351fe
commit 55750844ea
3 changed files with 4 additions and 4 deletions

View File

@@ -271,7 +271,7 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
#if defined(EMSESP_DEBUG)
LOG_DEBUG("[DEBUG] Calling %s command '%s' to retrieve attributes", dname, cmd);
#endif
return EMSESP::get_device_value_info(output, cmd, id, device_type) ? CommandRet::OK : CommandRet::ERROR; // entity = cmd
return EMSESP::get_device_value_info(output, cmd, id, device_type, device_id) ? CommandRet::OK : CommandRet::ERROR; // entity = cmd
}
}

View File

@@ -640,9 +640,9 @@ void EMSESP::publish_response(std::shared_ptr<const Telegram> telegram) {
}
// builds json with the detail of each value, for a specific EMS device type or the dallas sensor
bool EMSESP::get_device_value_info(JsonObject & root, const char * cmd, const int8_t id, const uint8_t devicetype) {
bool EMSESP::get_device_value_info(JsonObject & root, const char * cmd, const int8_t id, const uint8_t devicetype, const uint8_t device_id) {
for (const auto & emsdevice : emsdevices) {
if (emsdevice->device_type() == devicetype) {
if (emsdevice->device_type() == devicetype && emsdevice->device_id() == device_id) {
return emsdevice->get_value_info(root, cmd, id);
}
}

View File

@@ -136,7 +136,7 @@ class EMSESP {
static uint8_t count_devices();
static uint8_t device_index(const uint8_t device_type, const uint8_t unique_id);
static bool get_device_value_info(JsonObject & root, const char * cmd, const int8_t id, const uint8_t devicetype);
static bool get_device_value_info(JsonObject & root, const char * cmd, const int8_t id, const uint8_t devicetype, const uint8_t device_id);
static void show_device_values(uuid::console::Shell & shell);
static void show_sensor_values(uuid::console::Shell & shell);