From a9de8ec04669e6883ea29d5a228625e1d68a95fb Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Fri, 28 Jun 2024 07:23:12 +0200 Subject: [PATCH 1/3] fix ommands with auto-id (-1) --- src/command.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command.cpp b/src/command.cpp index afdbdaa8d..36c444a02 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -428,7 +428,7 @@ Command::CmdFunction * Command::find_command(const uint8_t device_type, const ui for (auto & cf : cmdfunctions_) { if (Helpers::toLower(cmd) == Helpers::toLower(cf.cmd_) && (cf.device_type_ == device_type) && (!device_id || cf.device_id_ == device_id) - && (flag & 0x3F) == (cf.flags_ & 0x3F)) { + && (flag == CommandFlag::CMD_FLAG_DEFAULT || (flag & 0x3F) == (cf.flags_ & 0x3F))) { return &cf; } } From b2b79734c191dffad9aea841daebe38dda3338fc Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Fri, 28 Jun 2024 07:25:06 +0200 Subject: [PATCH 2/3] don't update products with valid product-id --- src/emsesp.cpp | 2 +- src/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emsesp.cpp b/src/emsesp.cpp index aabaa64bc..26f26ec6d 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -1164,7 +1164,7 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const // first check to see if we already have it, if so update the record for (const auto & emsdevice : emsdevices) { if (emsdevice && emsdevice->is_device_id(device_id)) { - if (product_id == 0) { // update only with valid product_id + if (product_id == 0 || emsdevice->product_id() != 0) { // update only with valid product_id return true; } LOG_DEBUG("Updating details for already active deviceID 0x%02X", device_id); diff --git a/src/version.h b/src/version.h index 93d63925e..7f4909db6 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.7.0-dev.18" +#define EMSESP_APP_VERSION "3.7.0-dev.19" From c74ebc8aaea147daef6bcfd28117f67d1883dc45 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Fri, 28 Jun 2024 07:31:25 +0200 Subject: [PATCH 3/3] log text for command --- src/command.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command.cpp b/src/command.cpp index 36c444a02..773e0fa17 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -381,7 +381,7 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char * if ((value == nullptr) || (strlen(value) == 0)) { LOG_ERROR("Command '%s' failed with error '%s'", cmd, FL_(cmdRet)[return_code]); } else { - LOG_ERROR("Command '%s/%s' failed with error '%s'", cmd, value, FL_(cmdRet)[return_code]); + LOG_ERROR("Command '%s: %s' failed with error '%s'", cmd, value, FL_(cmdRet)[return_code]); } return message(return_code, "callback function failed", output); }