From f0489cb91872738f867ea54c26e5bc4320272002 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 11 Sep 2022 11:19:51 +0200 Subject: [PATCH] fix custom name saving --- src/emsdevice.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index c30fbee39..dd3bf1654 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -945,7 +945,7 @@ void EMSdevice::generate_values_web_customization(JsonArray & output) { // n is the fullname, and can be optional // don't add the fullname if its a command - auto fullname = dv.get_fullname(); + auto fullname = Helpers::translated_word(dv.fullname); if (dv.type != DeviceValueType::CMD) { if (!fullname.empty()) { if ((dv.tag == DeviceValueTAG::TAG_NONE) || tag_to_string(dv.tag).empty()) { @@ -1002,9 +1002,11 @@ void EMSdevice::setCustomEntity(const std::string & entity_id) { // always write the mask dv.state = ((dv.state & 0x0F) | (new_mask << 4)); // set state high bits to flag - // set the custom name if it has one + // set the custom name if it has one, or clear it if (has_custom_name) { dv.custom_fullname = entity_id.substr(custom_name_pos + 1); + } else { + dv.custom_fullname = ""; } return;