Skip to content

Commit

Permalink
Merge pull request #1336 from proddy/dev
Browse files Browse the repository at this point in the history
fixed helper text in entity dialog for numeric values
  • Loading branch information
proddy authored Oct 16, 2023
2 parents 9641adc + cb10663 commit 9962f16
Show file tree
Hide file tree
Showing 17 changed files with 833 additions and 96 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
- telegrams for RC100H, hc2 (seen on discord)
- names for BC400, GB192i, read temperatures for low loss header and heatblock [#1317](https://github.com/emsesp/EMS-ESP32/discussions/1317)
- option for `forceheatingoff` [#1262](https://github.com/emsesp/EMS-ESP32/issues/1262)
- shower_data MQTT payload contains the timestamp [#1329](https://github.com/emsesp/EMS-ESP32/issues/1329)

## Fixed

- fixed helper text in Web Device Entity dialog box for numerical ranges

## Changed

- update to arduino 2.0.14 / idf 4.4.6
Expand Down
2 changes: 1 addition & 1 deletion interface/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "EMS-ESP",
"version": "3.6.0",
"version": "3.6",
"description": "build EMS-ESP WebUI",
"homepage": "https://emsesp.github.io/docs",
"author": "proddy",
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/de/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const de: Translation = {
BROKER: 'Broker',
CLIENT: 'Client',
BASE_TOPIC: 'Base',
OPTIONAL: 'Optional',
OPTIONAL: 'Optional', // TODO translate
FORMATTING: 'Formattierung',
MQTT_FORMAT: 'Topic/Payload Format',
MQTT_NEST_1: 'Eingebettet in einem Gesamttopic',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const en: Translation = {
BROKER: 'Broker',
CLIENT: 'Client',
BASE_TOPIC: 'Base',
OPTIONAL: 'Optional',
OPTIONAL: 'optional',
FORMATTING: 'Formatting',
MQTT_FORMAT: 'Topic/Payload Format',
MQTT_NEST_1: 'Nested in a single topic',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const fr: Translation = {
BROKER: 'Broker',
CLIENT: 'Client',
BASE_TOPIC: 'Base',
OPTIONAL: 'Optionnel',
OPTIONAL: 'optionnel',
FORMATTING: 'Mise en forme',
MQTT_FORMAT: 'Format du Topic/Payload',
MQTT_NEST_1: 'Englobé dans un topic unique',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/it/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const it: Translation = {
BROKER: 'Broker',
CLIENT: 'Cliente',
BASE_TOPIC: 'Base',
OPTIONAL: 'Opzionale',
OPTIONAL: 'opzionale',
FORMATTING: 'Formattazione',
MQTT_FORMAT: 'Formato Topic/Payload ',
MQTT_NEST_1: 'Inserito in un singolo argomento',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/nl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const nl: Translation = {
BROKER: 'Broker',
CLIENT: 'Client',
BASE_TOPIC: 'Base',
OPTIONAL: 'Optioneel',
OPTIONAL: 'optioneel',
FORMATTING: 'Formatteren',
MQTT_FORMAT: 'Topic/Payload Formattering',
MQTT_NEST_1: 'Genest in 1 topic',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/no/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const no: Translation = {
BROKER: 'Broker',
CLIENT: 'Client',
BASE_TOPIC: 'Base',
OPTIONAL: 'Valgfritt',
OPTIONAL: 'valgfritt',
FORMATTING: 'Formatering',
MQTT_FORMAT: 'Topic/Payload Format',
MQTT_NEST_1: 'Nestet i en topic',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/sv/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const sv: Translation = {
BROKER: 'Broker',
CLIENT: 'Client',
BASE_TOPIC: 'Base',
OPTIONAL: 'Valfritt',
OPTIONAL: 'valfritt',
FORMATTING: 'Formatering',
MQTT_FORMAT: 'Topic/Payload Format',
MQTT_NEST_1: 'Nestlat i en topic.',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/tr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const tr: Translation = {
BROKER: 'Aracı',
CLIENT: 'İstemci',
BASE_TOPIC: 'Merkez',
OPTIONAL: 'Seçenekli',
OPTIONAL: 'seçenekli',
FORMATTING: 'Biçimlendiriliyor',
MQTT_FORMAT: 'Konu/Mesaj Biçimi',
MQTT_NEST_1: 'Tek konu üzerine yerleşmiş',
Expand Down
33 changes: 11 additions & 22 deletions interface/src/project/DashboardDevicesDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,16 @@ const DashboardDevicesDialog = ({
}
};

const showHelperText = (dv: DeviceValue) => {
if (dv.h) {
return dv.h;
}
if (dv.l) {
return '[ ' + dv.l.join(' | ') + ' ]';
}

let helperText = '<';
if (dv.s) {
helperText += 'n';
if (dv.m !== undefined && dv.x !== undefined) {
helperText += ' between ' + dv.m + ' and ' + dv.x;
} else {
helperText += ' , step ' + dv.s;
}
} else {
helperText += 'text';
}
return helperText + '>';
};
const showHelperText = (dv: DeviceValue) =>
dv.h ? (
dv.h
) : dv.l ? (
dv.l.join(' | ')
) : dv.m !== undefined && dv.x !== undefined ? (
<>
{dv.m}&nbsp;&rarr;&nbsp;{dv.x}
</>
) : undefined;

return (
<Dialog sx={dialogStyle} open={open} onClose={close}>
Expand Down Expand Up @@ -171,7 +160,7 @@ const DashboardDevicesDialog = ({
</Grid>
{writeable && (
<Grid item>
<FormHelperText>format:&nbsp;{showHelperText(editItem)}</FormHelperText>
<FormHelperText>{showHelperText(editItem)}</FormHelperText>
</Grid>
)}
</Grid>
Expand Down
16 changes: 15 additions & 1 deletion mock-api/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
{
"name": "mock-api",
"name": "api",
"version": "1.0.0",
"description": "mock api for EMS-ESP",
"author": "proddy",
"main": "server.js",
"scripts": {
"dev": "node --watch ./server.js localhost 3080",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@msgpack/msgpack": "^2.8.0",
"compression": "^1.7.4",
"express": "^4.18.2",
"multer": "^1.4.5-lts.1"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 9962f16

Please sign in to comment.