diff --git a/interface/src/project/SettingsCustomization.tsx b/interface/src/project/SettingsCustomization.tsx index bf392ea3b..c2895e291 100644 --- a/interface/src/project/SettingsCustomization.tsx +++ b/interface/src/project/SettingsCustomization.tsx @@ -169,8 +169,8 @@ const SettingsCustomization: FC = () => { return de.id; } - if (de.n === '') { - return LL.COMMAND() + ': ' + de.id; + if (de.n[0] === '!') { + return LL.COMMAND() + ': ' + de.n.slice(1); } return ( @@ -316,6 +316,10 @@ const SettingsCustomization: FC = () => { }; const editEntity = (de: DeviceEntity) => { + if (de.n && de.n[0] === '!') { + return; + } + if (de.cn === undefined) { de.cn = ''; } diff --git a/mock-api/server.js b/mock-api/server.js index 7fed12ded..420bbf4d7 100644 --- a/mock-api/server.js +++ b/mock-api/server.js @@ -623,7 +623,7 @@ const emsesp_deviceentities_1 = [ ] const emsesp_deviceentities_2 = [ - { u: 0, n: '', id: 'reset', m: 8, w: false }, + { u: 0, n: '!reset', id: 'reset', m: 8, w: false }, { v: false, n: 'heating active', id: 'heatingactive', m: 8, w: false }, { v: false, n: 'tapwater active', id: 'tapwateractive', m: 4, w: false }, { v: 5, n: 'selected flow temperature', id: 'selflowtemp', m: 4, w: true }, diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index 51667ddb1..3c4ab5170 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -956,13 +956,14 @@ void EMSdevice::generate_values_web_customization(JsonArray & output) { obj["n"] = name; } } - } else { - obj["n"] = ""; - } - // add the custom name, is optional - if (!dv.custom_fullname.empty()) { - obj["cn"] = dv.custom_fullname; + // add the custom name, is optional + if (!dv.custom_fullname.empty()) { + obj["cn"] = dv.custom_fullname; + } + } else { + // it's a command + obj["n"] = "!" + fullname; // prefix ! to fullname for commands } obj["m"] = dv.state >> 4; // send back the mask state. We're only interested in the high nibble