mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
commands like reset can't be renamed. use translated name for commands like these.
This commit is contained in:
@@ -169,8 +169,8 @@ const SettingsCustomization: FC = () => {
|
|||||||
return de.id;
|
return de.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (de.n === '') {
|
if (de.n[0] === '!') {
|
||||||
return LL.COMMAND() + ': ' + de.id;
|
return LL.COMMAND() + ': ' + de.n.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -316,6 +316,10 @@ const SettingsCustomization: FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const editEntity = (de: DeviceEntity) => {
|
const editEntity = (de: DeviceEntity) => {
|
||||||
|
if (de.n && de.n[0] === '!') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (de.cn === undefined) {
|
if (de.cn === undefined) {
|
||||||
de.cn = '';
|
de.cn = '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -623,7 +623,7 @@ const emsesp_deviceentities_1 = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
const emsesp_deviceentities_2 = [
|
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: 'heating active', id: 'heatingactive', m: 8, w: false },
|
||||||
{ v: false, n: 'tapwater active', id: 'tapwateractive', m: 4, 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 },
|
{ v: 5, n: 'selected flow temperature', id: 'selflowtemp', m: 4, w: true },
|
||||||
|
|||||||
@@ -956,13 +956,14 @@ void EMSdevice::generate_values_web_customization(JsonArray & output) {
|
|||||||
obj["n"] = name;
|
obj["n"] = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
obj["n"] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
// add the custom name, is optional
|
// add the custom name, is optional
|
||||||
if (!dv.custom_fullname.empty()) {
|
if (!dv.custom_fullname.empty()) {
|
||||||
obj["cn"] = dv.custom_fullname;
|
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
|
obj["m"] = dv.state >> 4; // send back the mask state. We're only interested in the high nibble
|
||||||
|
|||||||
Reference in New Issue
Block a user