diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index 3e0b4348c..a130bc57e 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -638,7 +638,7 @@ void EMSdevice::generate_values_web(JsonObject & output) { JsonArray data = output.createNestedArray("data"); // sort the device values - std::sort(devicevalues_.begin(), devicevalues_.end(), [](const emsesp::DeviceValue & a, const emsesp::DeviceValue & b) { + std::sort(devicevalues_.begin(), devicevalues_.end(), [](const emsesp::DeviceValue & a, const emsesp::DeviceValue & b __attribute__((unused))) { return a.has_state(DeviceValueState::DV_FAVORITE); }); @@ -858,7 +858,7 @@ void EMSdevice::reset_entity_masks() { } // disable/exclude/mask_out a device entity based on the id -void EMSdevice::mask_entity(std::string entity_id) { +void EMSdevice::mask_entity(std::string & entity_id) { // first character contains mask flags uint8_t flag = Helpers::hextoint(entity_id.substr(0, 2).c_str()); for (auto & dv : devicevalues_) { diff --git a/src/emsdevice.h b/src/emsdevice.h index a521a042c..081f61bc1 100644 --- a/src/emsdevice.h +++ b/src/emsdevice.h @@ -183,7 +183,7 @@ class EMSdevice { char * show_telegram_handlers(char * result, const size_t len, const uint8_t handlers); void show_mqtt_handlers(uuid::console::Shell & shell) const; void list_device_entries(JsonObject & output) const; - void mask_entity(std::string entity_id); + void mask_entity(std::string & entity_id); void reset_entity_masks(); using process_function_p = std::function)>; diff --git a/src/test/test.cpp b/src/test/test.cpp index 960332c58..52e546ce4 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -609,7 +609,8 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const // toggle mode for (const auto & emsdevice : EMSESP::emsdevices) { if (emsdevice->unique_id() == 1) { // boiler - emsdevice->mask_entity("07wwseltemp"); + std::string a = "07wwseltemp"; + emsdevice->mask_entity(a); break; } }