diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index fa2a5b6d4..7584d3753 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -911,7 +911,7 @@ bool EMSdevice::get_value_info(JsonObject & output, const char * cmd, const int8 int8_t tag = id; // check if we have hc or wwc or hs - if (id >= 1 && id <= 34) { + if (id >= 1 && id <= (1 + DeviceValueTAG::TAG_HS16 - DeviceValueTAG::TAG_HC1)) { tag = DeviceValueTAG::TAG_HC1 + id - 1; } diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 3e2e60a7b..dfa22fa9a 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -1100,7 +1100,7 @@ bool EMSESP::command_commands(uint8_t device_type, JsonObject & output, const in bool EMSESP::command_info(uint8_t device_type, JsonObject & output, const int8_t id, const uint8_t output_target) { bool has_value = false; uint8_t tag; - if (id >= 1 && id <= 34) { + if (id >= 1 && id <= (1 + DeviceValueTAG::TAG_HS16 - DeviceValueTAG::TAG_HC1)) { tag = DeviceValueTAG::TAG_HC1 + id - 1; // this sets also WWC and HS } else if (id == -1 || id == 0) { tag = DeviceValueTAG::TAG_NONE;