From d6ee8ccb2d6151818a906d0d577f62581f31f153 Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 25 Sep 2022 10:44:04 +0200 Subject: [PATCH 1/3] fix reset translation --- src/locale_translations.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale_translations.h b/src/locale_translations.h index 46b4534d6..81b173145 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -26,7 +26,7 @@ #define EMSESP_LOCALE_PL "pl" #define EMSESP_LOCALE_NO "no" -// translations are in order en, de,nl, se.... +// translations are in order en, de, nl, se, pl, no.... // if there is no translation, it will default to en // General @@ -171,7 +171,7 @@ MAKE_PSTR_LIST(cyl2, F("cyl 2"), F("Zyl_2"), F("Cil 2"), F("Cyl 2")) // Entity translations // Boiler MAKE_PSTR_LIST(wwtapactivated, F("wwtapactivated"), F("turn on/off"), F("Durchlauferhitzer aktiv"), F("zet aan/uit"), F("sätt på/av")) -MAKE_PSTR_LIST(reset, F("reset"), F("Reset"), F("Reset"), F("Nollställ"), F("reset")) +MAKE_PSTR_LIST(reset, F("reset"), F("Reset"), F("Reset"), F("Reset"), F("Nollställ")) MAKE_PSTR_LIST(oilPreHeat, F("oilpreheat"), F("oil preheating"), F("Ölvorwärmung"), F("Olie voorverwarming"), F("Förvärmning olja")) MAKE_PSTR_LIST(heatingActive, F("heatingactive"), F("heating active"), F("Heizen aktiv"), F("Verwarming actief"), F("Uppvärmning aktiv")) MAKE_PSTR_LIST(tapwaterActive, F("tapwateractive"), F("tapwater active"), F("Warmwasser aktiv"), F("Warm water actief"), F("Varmvatten aktiv")) From c841c8c284cedcf3e05c4d2e7e65b7219b49f607 Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 25 Sep 2022 10:44:23 +0200 Subject: [PATCH 2/3] lighter grey colour --- interface/src/components/upload/SingleUpload.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/components/upload/SingleUpload.tsx b/interface/src/components/upload/SingleUpload.tsx index 574f4dae0..d4e4e3c3d 100644 --- a/interface/src/components/upload/SingleUpload.tsx +++ b/interface/src/components/upload/SingleUpload.tsx @@ -64,7 +64,7 @@ const SingleUpload: FC = ({ onDrop, onCancel, uploading, prog borderWidth: 2, borderRadius: 2, borderStyle: 'dashed', - color: theme.palette.grey[700], + color: theme.palette.grey[400], transition: 'border .24s ease-in-out', width: '100%', cursor: uploading ? 'default' : 'pointer', From 96af9afc836ecd5b22b04d9cf5c75fcb18f4643f Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 25 Sep 2022 10:45:08 +0200 Subject: [PATCH 3/3] commands like reset can't be renamed. use translated name for commands like these. --- interface/src/project/SettingsCustomization.tsx | 8 ++++++-- mock-api/server.js | 2 +- src/emsdevice.cpp | 13 +++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) 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