Skip to content

Commit 8d9ca33

Browse files
committed
bitmask for bool custom entities as hex value
1 parent 79cc037 commit 8d9ca33

File tree

14 files changed

+114
-6
lines changed

14 files changed

+114
-6
lines changed

interface/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"typescript": "^5.8.2"
4242
},
4343
"devDependencies": {
44-
"@babel/core": "^7.26.9",
44+
"@babel/core": "^7.26.10",
4545
"@eslint/js": "^9.22.0",
4646
"@preact/compat": "^18.3.1",
4747
"@preact/preset-vite": "^2.10.1",

interface/src/app/main/CustomEntitiesDialog.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ const CustomEntitiesDialog = ({
6161
setEditItem({
6262
...selectedItem,
6363
device_id: selectedItem.device_id.toString(16).toUpperCase(),
64-
type_id: selectedItem.type_id.toString(16).toUpperCase()
64+
type_id: selectedItem.type_id.toString(16).toUpperCase(),
65+
factor: selectedItem.value_type === DeviceValueType.BOOL ? selectedItem.factor.toString(16).toUpperCase() : selectedItem.factor
6566
});
6667
}
6768
}, [open, selectedItem]);
@@ -82,6 +83,9 @@ const CustomEntitiesDialog = ({
8283
if (typeof editItem.type_id === 'string') {
8384
editItem.type_id = parseInt(editItem.type_id, 16);
8485
}
86+
if (editItem.value_type === DeviceValueType.BOOL && typeof editItem.factor === 'string') {
87+
editItem.factor = parseInt(editItem.factor, 16);
88+
}
8589
onSave(editItem);
8690
} catch (error) {
8791
setFieldErrors(error as ValidateFieldsError);
@@ -315,7 +319,7 @@ const CustomEntitiesDialog = ({
315319
<ValidatedTextField
316320
fieldErrors={fieldErrors}
317321
name="factor"
318-
label="Bytes"
322+
label={LL.BYTES()}
319323
value={numberValue(editItem.factor as number)}
320324
sx={{ width: '11ch' }}
321325
variant="outlined"
@@ -333,7 +337,7 @@ const CustomEntitiesDialog = ({
333337
<ValidatedTextField
334338
fieldErrors={fieldErrors}
335339
name="factor"
336-
label="Mask"
340+
label={LL.BITMASK()}
337341
value={editItem.factor as string}
338342
sx={{ width: '11ch' }}
339343
variant="outlined"

interface/src/i18n/cz/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ const cz: Translation = {
340340
AUTO_SCROLL: 'Automatické rolování',
341341
DASHBOARD: 'Dashboard',
342342
DEVELOPER_MODE: 'Režim vývojáře',
343+
BYTES: 'Bytes', // TODO translate
344+
BITMASK: 'Bit Mask',// TODO translate
343345
DUPLICATE: 'Duplikát',
344346
UPGRADE: 'Upgrade',
345347
DASHBOARD_1: 'Všechny aktivní entity EMS jsou označené jako oblíbené. Všechny vlastní entity, harmonogramy a externí sensory jsou zobrazeny níže.',

interface/src/i18n/de/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ const de: Translation = {
340340
AUTO_SCROLL: 'Automatisches Scrollen',
341341
DASHBOARD: 'Dashboard',
342342
DEVELOPER_MODE: 'Entwicklermodus',
343+
BYTES: 'Bytes',
344+
BITMASK: 'Bit Maske',
343345
DUPLICATE: 'Kopieren',
344346
UPGRADE: 'Aktualisieren',
345347
DASHBOARD_1: 'Alle EMS-Entitäten, die aktiv und als Favorit markiert sind, sowie alle benutzerdefinierten Entitäten, Zeitpläne und externen Sensordaten werden unten angezeigt.',

interface/src/i18n/en/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ const en: Translation = {
341341
DASHBOARD: 'Dashboard',
342342
DASHBOARD_1: 'All EMS entities that are active and marked as Favorite, plus all Custom Entities, Schedules and external Sensors data are displayed below.',
343343
DEVELOPER_MODE: 'Developer Mode',
344+
BYTES: 'Bytes',
345+
BITMASK: 'Bit Mask',
344346
DUPLICATE: 'Duplicate',
345347
UPGRADE: 'Upgrade',
346348
NO_DATA_1: 'No favorite EMS entities found yet. Use the',

interface/src/i18n/fr/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ const fr: Translation = {
340340
AUTO_SCROLL: 'Auto Scroll', // TODO translate
341341
DASHBOARD: 'Dashboard', // TODO translate
342342
DEVELOPER_MODE: 'Developer Mode', // TODO translate
343+
BYTES: 'Bytes', // TODO translate
344+
BITMASK: 'Bit Mask',// TODO translate
343345
DUPLICATE: 'Duplicate', // TODO translate
344346
UPGRADE: 'Upgrade', // TODO translate
345347
DASHBOARD_1: 'All EMS entities that are active and marked as Favorite, plus all Custom Entities, Schedules and external Sensors data are displayed below.', // TODO translate

interface/src/i18n/it/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ const it: Translation = {
340340
AUTO_SCROLL: 'Auto Scroll', // TODO translate
341341
DASHBOARD: 'Dashboard', // TODO translate
342342
DEVELOPER_MODE: 'Developer Mode', // TODO translate
343+
BYTES: 'Bytes', // TODO translate
344+
BITMASK: 'Bit Mask',// TODO translate
343345
DUPLICATE: 'Duplicate', // TODO translate
344346
UPGRADE: 'Upgrade', // TODO translate
345347
DASHBOARD_1: 'All EMS entities that are active and marked as Favorite, plus all Custom Entities, Schedules and external Sensors data are displayed below.', // TODO translate

interface/src/i18n/nl/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ const nl: Translation = {
340340
AUTO_SCROLL: 'Automatisch Scrollen',
341341
DASHBOARD: 'Dashboard',
342342
DEVELOPER_MODE: 'Ontwikkelaarsmodus',
343+
BYTES: 'Bytes', // TODO translate
344+
BITMASK: 'Bit Mask',// TODO translate
343345
DUPLICATE: 'Duplicaat',
344346
UPGRADE: 'Upgraden',
345347
DASHBOARD_1: 'Alle EMS-entiteiten die actief zijn en als favoriet zijn gemarkeerd, plus alle aangepaste entiteiten en externe sensorgegevens worden hieronder weergegeven.',

interface/src/i18n/no/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ const no: Translation = {
340340
AUTO_SCROLL: 'Auto Scroll', // TODO translate
341341
DASHBOARD: 'Dashboard', // TODO translate
342342
DEVELOPER_MODE: 'Developer Mode', // TODO translate
343+
BYTES: 'Bytes', // TODO translate
344+
BITMASK: 'Bit Mask',// TODO translate
343345
DUPLICATE: 'Duplicate', // TODO translate
344346
UPGRADE: 'Upgrade', // TODO translate
345347
DASHBOARD_1: 'All EMS entities that are active and marked as Favorite, plus all Custom Entities, Schedules and external Sensors data are displayed below.', // TODO translate

interface/src/i18n/pl/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ const pl: BaseTranslation = {
340340
AUTO_SCROLL: 'Auto Scroll', // TODO translate
341341
DASHBOARD: 'Dashboard', // TODO translate
342342
DEVELOPER_MODE: 'Developer Mode', // TODO translate
343+
BYTES: 'Bytes', // TODO translate
344+
BITMASK: 'Bit Mask',// TODO translate
343345
DUPLICATE: 'Duplicate', // TODO translate
344346
UPGRADE: 'Upgrade', // TODO translate
345347
DASHBOARD_1: 'All EMS entities that are active and marked as Favorite, plus all Custom Entities, Schedules and external Sensors data are displayed below.', // TODO translate

interface/src/i18n/sk/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ const sk: Translation = {
340340
AUTO_SCROLL: 'Automatické rolovanie',
341341
DASHBOARD: 'Panel',
342342
DEVELOPER_MODE: 'Režim vývojára',
343+
BYTES: 'Bytes', // TODO translate
344+
BITMASK: 'Bit Mask',// TODO translate
343345
DUPLICATE: 'Duplicitné',
344346
UPGRADE: 'Inovovať',
345347
DASHBOARD_1: 'Všetky entity EMS, ktoré sú aktívne a označené ako obľúbené, plus všetky vlastné entity, plány a údaje externých senzorov sú zobrazené nižšie.',

interface/src/i18n/sv/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ const sv: Translation = {
340340
AUTO_SCROLL: 'Autoskrolla',
341341
DASHBOARD: 'Kontrollpanel',
342342
DEVELOPER_MODE: 'Utvecklarläge',
343+
BYTES: 'Bytes', // TODO translate
344+
BITMASK: 'Bit Mask',// TODO translate
343345
DUPLICATE: 'Dublett',
344346
UPGRADE: 'Uppgradera',
345347
DASHBOARD_1: 'All EMS entities that are active and marked as Favorite, plus all Custom Entities, Schedules and external Sensors data are displayed below.', // TODO translate

interface/src/i18n/tr/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ const tr: Translation = {
340340
AUTO_SCROLL: 'Auto Scroll', // TODO translate
341341
DASHBOARD: 'Dashboard', // TODO translate
342342
DEVELOPER_MODE: 'Developer Mode', // TODO translate
343+
BYTES: 'Bytes', // TODO translate
344+
BITMASK: 'Bit Mask',// TODO translate
343345
DUPLICATE: 'Duplicate', // TODO translate
344346
UPGRADE: 'Upgrade', // TODO translate
345347
DASHBOARD_1: 'All EMS entities that are active and marked as Favorite, plus all Custom Entities, Schedules and external Sensors data are displayed below.', // TODO translate

interface/yarn.lock

+84-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ __metadata:
5151
languageName: node
5252
linkType: hard
5353

54-
"@babel/core@npm:^7.22.1, @babel/core@npm:^7.26.9":
54+
"@babel/core@npm:^7.22.1":
5555
version: 7.26.9
5656
resolution: "@babel/core@npm:7.26.9"
5757
dependencies:
@@ -74,6 +74,42 @@ __metadata:
7474
languageName: node
7575
linkType: hard
7676

77+
"@babel/core@npm:^7.26.10":
78+
version: 7.26.10
79+
resolution: "@babel/core@npm:7.26.10"
80+
dependencies:
81+
"@ampproject/remapping": "npm:^2.2.0"
82+
"@babel/code-frame": "npm:^7.26.2"
83+
"@babel/generator": "npm:^7.26.10"
84+
"@babel/helper-compilation-targets": "npm:^7.26.5"
85+
"@babel/helper-module-transforms": "npm:^7.26.0"
86+
"@babel/helpers": "npm:^7.26.10"
87+
"@babel/parser": "npm:^7.26.10"
88+
"@babel/template": "npm:^7.26.9"
89+
"@babel/traverse": "npm:^7.26.10"
90+
"@babel/types": "npm:^7.26.10"
91+
convert-source-map: "npm:^2.0.0"
92+
debug: "npm:^4.1.0"
93+
gensync: "npm:^1.0.0-beta.2"
94+
json5: "npm:^2.2.3"
95+
semver: "npm:^6.3.1"
96+
checksum: 10c0/e046e0e988ab53841b512ee9d263ca409f6c46e2a999fe53024688b92db394346fa3aeae5ea0866331f62133982eee05a675d22922a4603c3f603aa09a581d62
97+
languageName: node
98+
linkType: hard
99+
100+
"@babel/generator@npm:^7.26.10":
101+
version: 7.26.10
102+
resolution: "@babel/generator@npm:7.26.10"
103+
dependencies:
104+
"@babel/parser": "npm:^7.26.10"
105+
"@babel/types": "npm:^7.26.10"
106+
"@jridgewell/gen-mapping": "npm:^0.3.5"
107+
"@jridgewell/trace-mapping": "npm:^0.3.25"
108+
jsesc: "npm:^3.0.2"
109+
checksum: 10c0/88b3b3ea80592fc89349c4e1a145e1386e4042866d2507298adf452bf972f68d13bf699a845e6ab8c028bd52c2247013eb1221b86e1db5c9779faacba9c4b10e
110+
languageName: node
111+
linkType: hard
112+
77113
"@babel/generator@npm:^7.26.5, @babel/generator@npm:^7.26.9":
78114
version: 7.26.9
79115
resolution: "@babel/generator@npm:7.26.9"
@@ -160,6 +196,16 @@ __metadata:
160196
languageName: node
161197
linkType: hard
162198

199+
"@babel/helpers@npm:^7.26.10":
200+
version: 7.26.10
201+
resolution: "@babel/helpers@npm:7.26.10"
202+
dependencies:
203+
"@babel/template": "npm:^7.26.9"
204+
"@babel/types": "npm:^7.26.10"
205+
checksum: 10c0/f99e1836bcffce96db43158518bb4a24cf266820021f6461092a776cba2dc01d9fc8b1b90979d7643c5c2ab7facc438149064463a52dd528b21c6ab32509784f
206+
languageName: node
207+
linkType: hard
208+
163209
"@babel/helpers@npm:^7.26.9":
164210
version: 7.26.9
165211
resolution: "@babel/helpers@npm:7.26.9"
@@ -170,6 +216,17 @@ __metadata:
170216
languageName: node
171217
linkType: hard
172218

219+
"@babel/parser@npm:^7.26.10":
220+
version: 7.26.10
221+
resolution: "@babel/parser@npm:7.26.10"
222+
dependencies:
223+
"@babel/types": "npm:^7.26.10"
224+
bin:
225+
parser: ./bin/babel-parser.js
226+
checksum: 10c0/c47f5c0f63cd12a663e9dc94a635f9efbb5059d98086a92286d7764357c66bceba18ccbe79333e01e9be3bfb8caba34b3aaebfd8e62c3d5921c8cf907267be75
227+
languageName: node
228+
linkType: hard
229+
173230
"@babel/parser@npm:^7.26.7, @babel/parser@npm:^7.26.9":
174231
version: 7.26.9
175232
resolution: "@babel/parser@npm:7.26.9"
@@ -253,6 +310,21 @@ __metadata:
253310
languageName: node
254311
linkType: hard
255312

313+
"@babel/traverse@npm:^7.26.10":
314+
version: 7.26.10
315+
resolution: "@babel/traverse@npm:7.26.10"
316+
dependencies:
317+
"@babel/code-frame": "npm:^7.26.2"
318+
"@babel/generator": "npm:^7.26.10"
319+
"@babel/parser": "npm:^7.26.10"
320+
"@babel/template": "npm:^7.26.9"
321+
"@babel/types": "npm:^7.26.10"
322+
debug: "npm:^4.3.1"
323+
globals: "npm:^11.1.0"
324+
checksum: 10c0/4e86bb4e3c30a6162bb91df86329df79d96566c3e2d9ccba04f108c30473a3a4fd360d9990531493d90f6a12004f10f616bf9b9229ca30c816b708615e9de2ac
325+
languageName: node
326+
linkType: hard
327+
256328
"@babel/types@npm:^7.25.9, @babel/types@npm:^7.26.7, @babel/types@npm:^7.26.9":
257329
version: 7.26.9
258330
resolution: "@babel/types@npm:7.26.9"
@@ -263,6 +335,16 @@ __metadata:
263335
languageName: node
264336
linkType: hard
265337

338+
"@babel/types@npm:^7.26.10":
339+
version: 7.26.10
340+
resolution: "@babel/types@npm:7.26.10"
341+
dependencies:
342+
"@babel/helper-string-parser": "npm:^7.25.9"
343+
"@babel/helper-validator-identifier": "npm:^7.25.9"
344+
checksum: 10c0/7a7f83f568bfc3dfabfaf9ae3a97ab5c061726c0afa7dcd94226d4f84a81559da368ed79671e3a8039d16f12476cf110381a377ebdea07587925f69628200dac
345+
languageName: node
346+
linkType: hard
347+
266348
"@emotion/babel-plugin@npm:^11.13.5":
267349
version: 11.13.5
268350
resolution: "@emotion/babel-plugin@npm:11.13.5"
@@ -1591,7 +1673,7 @@ __metadata:
15911673
resolution: "EMS-ESP@workspace:."
15921674
dependencies:
15931675
"@alova/adapter-xhr": "npm:2.1.1"
1594-
"@babel/core": "npm:^7.26.9"
1676+
"@babel/core": "npm:^7.26.10"
15951677
"@emotion/react": "npm:^11.14.0"
15961678
"@emotion/styled": "npm:^11.14.0"
15971679
"@eslint/js": "npm:^9.22.0"

0 commit comments

Comments
 (0)