@iobroker/repochecker 5.22.3 → 5.22.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/lib/M5600__I18n.js +14 -0
- package/lib/config_StateRoles.js +331 -0
- package/lib/objectStructure.js +9 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,6 +56,15 @@ GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
56
56
|
Placeholder for the next version (at the beginning of the line):
|
|
57
57
|
### **WORK IN PROGRESS**
|
|
58
58
|
-->
|
|
59
|
+
### 5.22.5 (2026-09-22)
|
|
60
|
+
|
|
61
|
+
* (mcm1957) W5612/E5612 no longer report strings that never need a translation (e.g. "iobroker", "AABBCCDDEEFF"); matched case-insensitively
|
|
62
|
+
|
|
63
|
+
### 5.22.4 (2026-09-13)
|
|
64
|
+
|
|
65
|
+
* (mcm1957) object structure check now reports states with role 'button' that do not have read:false and write:true
|
|
66
|
+
* (mcm1957) object structure check state roles synchronized with the ioBroker state-roles documentation (new roles added)
|
|
67
|
+
|
|
59
68
|
### 5.22.3 (2026-09-13)
|
|
60
69
|
|
|
61
70
|
* (mcm1957) adapter README.md german and install checks
|
package/lib/M5600__I18n.js
CHANGED
|
@@ -33,6 +33,16 @@ const TRANSLATABLE_ATTRS = [
|
|
|
33
33
|
'validatorErrorText',
|
|
34
34
|
];
|
|
35
35
|
const MAX_W5612_WARNINGS = 10;
|
|
36
|
+
|
|
37
|
+
// Strings that do not need a translation at all and therefore must not raise
|
|
38
|
+
// W5612/E5612. Compared case-insensitively against the attribute value.
|
|
39
|
+
const W5612_TRANSLATION_EXCLUSIONS = [
|
|
40
|
+
'aabbccddeeff',
|
|
41
|
+
'iobroker',
|
|
42
|
+
'xxxxxxxxxxxxxxxxxxxxxxxx.yyyyyy.zzzzzzzzzzzzzzzzzzzzzzzzzzz',
|
|
43
|
+
'example@gmail.com',
|
|
44
|
+
'url',
|
|
45
|
+
];
|
|
36
46
|
const MAX_W5606_EXAMPLES = 2;
|
|
37
47
|
const MIN_WORDS_FOR_W5606 = 5;
|
|
38
48
|
const MAX_56XX_ISSUES_PER_CODE = 10;
|
|
@@ -596,6 +606,10 @@ function checkJsonConfigTranslations(context, configFile, jsonConfig, i18nDir, w
|
|
|
596
606
|
}
|
|
597
607
|
// i18n enabled: check that the string is a valid key in the English translations
|
|
598
608
|
if (!Object.prototype.hasOwnProperty.call(enTranslations, value)) {
|
|
609
|
+
if (W5612_TRANSLATION_EXCLUSIONS.includes(value.toLowerCase())) {
|
|
610
|
+
// Value is on the list of strings that never need a translation
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
599
613
|
if (value.match(/[a-zA-Z]/) && value.length >= 3) {
|
|
600
614
|
// do not force translations of labels containing no characters
|
|
601
615
|
if (w5612State.count < MAX_W5612_WARNINGS) {
|
package/lib/config_StateRoles.js
CHANGED
|
@@ -72,6 +72,18 @@ const STATE_SCHEMA = {
|
|
|
72
72
|
'common.enums': { types: ['array'] },
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// STATE_ROLE_RULES is derived from the official ioBroker state-roles documentation:
|
|
77
|
+
// https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/stateroles.md
|
|
78
|
+
//
|
|
79
|
+
// STATEROLES_DOC_COMMIT tracks the commit of stateroles.md these rules were last
|
|
80
|
+
// synchronized against. This makes it easy to diff the doc for later changes.
|
|
81
|
+
//
|
|
82
|
+
// NOTE: Whenever these rules are changed by Claude to match the documentation,
|
|
83
|
+
// update STATEROLES_DOC_COMMIT to the doc commit the change is based on.
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
const STATEROLES_DOC_COMMIT = '3bee38fb14e880402558752618945e19e17f90e0'; // stateroles.md @ 2026-08-13
|
|
86
|
+
|
|
75
87
|
const STATE_ROLE_RULES = {
|
|
76
88
|
'adapter.messagebox': {
|
|
77
89
|
types: ['object'],
|
|
@@ -86,6 +98,11 @@ const STATE_ROLE_RULES = {
|
|
|
86
98
|
read: false,
|
|
87
99
|
write: true,
|
|
88
100
|
},
|
|
101
|
+
'button.close': {
|
|
102
|
+
types: ['boolean'],
|
|
103
|
+
read: false,
|
|
104
|
+
write: true,
|
|
105
|
+
},
|
|
89
106
|
'button.close.blind': {
|
|
90
107
|
types: ['boolean'],
|
|
91
108
|
read: false,
|
|
@@ -111,6 +128,11 @@ const STATE_ROLE_RULES = {
|
|
|
111
128
|
read: false,
|
|
112
129
|
write: true,
|
|
113
130
|
},
|
|
131
|
+
'button.home': {
|
|
132
|
+
types: ['boolean'],
|
|
133
|
+
read: false,
|
|
134
|
+
write: true,
|
|
135
|
+
},
|
|
114
136
|
'button.long': {
|
|
115
137
|
types: ['boolean'],
|
|
116
138
|
read: false,
|
|
@@ -137,6 +159,11 @@ const STATE_ROLE_RULES = {
|
|
|
137
159
|
write: true,
|
|
138
160
|
},
|
|
139
161
|
'button.next': {},
|
|
162
|
+
'button.open': {
|
|
163
|
+
types: ['boolean'],
|
|
164
|
+
read: false,
|
|
165
|
+
write: true,
|
|
166
|
+
},
|
|
140
167
|
'button.open.blind': {
|
|
141
168
|
types: ['boolean'],
|
|
142
169
|
read: false,
|
|
@@ -197,6 +224,11 @@ const STATE_ROLE_RULES = {
|
|
|
197
224
|
read: false,
|
|
198
225
|
write: true,
|
|
199
226
|
},
|
|
227
|
+
'button.stop.blind': {
|
|
228
|
+
types: ['boolean'],
|
|
229
|
+
read: false,
|
|
230
|
+
write: true,
|
|
231
|
+
},
|
|
200
232
|
'button.stop.tilt': {
|
|
201
233
|
types: ['boolean'],
|
|
202
234
|
read: false,
|
|
@@ -218,15 +250,22 @@ const STATE_ROLE_RULES = {
|
|
|
218
250
|
read: true,
|
|
219
251
|
},
|
|
220
252
|
'date.end': {},
|
|
253
|
+
'date.forecast.0': {},
|
|
221
254
|
'date.forecast.1': {},
|
|
222
255
|
'date.start': {},
|
|
223
256
|
'date.sunrise': {},
|
|
257
|
+
'date.sunrise.forecast.0': {},
|
|
224
258
|
'date.sunset': {},
|
|
259
|
+
'date.sunset.forecast.0': {},
|
|
225
260
|
dayofweek: {},
|
|
261
|
+
'dayofweek.forecast.0': {},
|
|
226
262
|
html: {
|
|
227
263
|
types: ['string'],
|
|
228
264
|
read: true,
|
|
229
265
|
},
|
|
266
|
+
icon: {
|
|
267
|
+
types: ['string'],
|
|
268
|
+
},
|
|
230
269
|
indicator: {
|
|
231
270
|
types: ['boolean'],
|
|
232
271
|
read: true,
|
|
@@ -252,11 +291,21 @@ const STATE_ROLE_RULES = {
|
|
|
252
291
|
read: true,
|
|
253
292
|
write: false,
|
|
254
293
|
},
|
|
294
|
+
'indicator.alarm.muted': {
|
|
295
|
+
types: ['boolean'],
|
|
296
|
+
read: true,
|
|
297
|
+
write: false,
|
|
298
|
+
},
|
|
255
299
|
'indicator.alarm.secure': {
|
|
256
300
|
types: ['boolean'],
|
|
257
301
|
read: true,
|
|
258
302
|
write: false,
|
|
259
303
|
},
|
|
304
|
+
'indicator.closed': {
|
|
305
|
+
types: ['boolean'],
|
|
306
|
+
read: true,
|
|
307
|
+
write: false,
|
|
308
|
+
},
|
|
260
309
|
'indicator.connected': {
|
|
261
310
|
types: ['boolean'],
|
|
262
311
|
read: true,
|
|
@@ -287,6 +336,11 @@ const STATE_ROLE_RULES = {
|
|
|
287
336
|
read: true,
|
|
288
337
|
write: false,
|
|
289
338
|
},
|
|
339
|
+
'indicator.maintenance.filter': {
|
|
340
|
+
types: ['boolean'],
|
|
341
|
+
read: true,
|
|
342
|
+
write: false,
|
|
343
|
+
},
|
|
290
344
|
'indicator.maintenance.lowbat': {
|
|
291
345
|
types: ['boolean'],
|
|
292
346
|
read: true,
|
|
@@ -298,6 +352,16 @@ const STATE_ROLE_RULES = {
|
|
|
298
352
|
write: false,
|
|
299
353
|
},
|
|
300
354
|
'indicator.maintenance.waste': {},
|
|
355
|
+
'indicator.maintenance.water': {
|
|
356
|
+
types: ['boolean'],
|
|
357
|
+
read: true,
|
|
358
|
+
write: false,
|
|
359
|
+
},
|
|
360
|
+
'indicator.opened': {
|
|
361
|
+
types: ['boolean'],
|
|
362
|
+
read: true,
|
|
363
|
+
write: false,
|
|
364
|
+
},
|
|
301
365
|
'indicator.reachable': {
|
|
302
366
|
types: ['boolean'],
|
|
303
367
|
read: true,
|
|
@@ -308,6 +372,11 @@ const STATE_ROLE_RULES = {
|
|
|
308
372
|
read: true,
|
|
309
373
|
write: false,
|
|
310
374
|
},
|
|
375
|
+
'indicator.working.test': {
|
|
376
|
+
types: ['boolean'],
|
|
377
|
+
read: true,
|
|
378
|
+
write: false,
|
|
379
|
+
},
|
|
311
380
|
'info.address': {
|
|
312
381
|
types: ['string'],
|
|
313
382
|
read: true,
|
|
@@ -401,6 +470,11 @@ const STATE_ROLE_RULES = {
|
|
|
401
470
|
read: true,
|
|
402
471
|
write: true,
|
|
403
472
|
},
|
|
473
|
+
'level.camera.position': {
|
|
474
|
+
types: ['number'],
|
|
475
|
+
read: true,
|
|
476
|
+
write: true,
|
|
477
|
+
},
|
|
404
478
|
'level.color.blue': {
|
|
405
479
|
types: ['number'],
|
|
406
480
|
read: true,
|
|
@@ -531,6 +605,11 @@ const STATE_ROLE_RULES = {
|
|
|
531
605
|
read: true,
|
|
532
606
|
write: true,
|
|
533
607
|
},
|
|
608
|
+
'level.mode.airflow': {
|
|
609
|
+
types: ['number'],
|
|
610
|
+
read: true,
|
|
611
|
+
write: true,
|
|
612
|
+
},
|
|
534
613
|
'level.mode.cleanup': {
|
|
535
614
|
types: ['number'],
|
|
536
615
|
read: true,
|
|
@@ -551,11 +630,21 @@ const STATE_ROLE_RULES = {
|
|
|
551
630
|
read: true,
|
|
552
631
|
write: true,
|
|
553
632
|
},
|
|
633
|
+
'level.mode.vacuum': {
|
|
634
|
+
types: ['number'],
|
|
635
|
+
read: true,
|
|
636
|
+
write: true,
|
|
637
|
+
},
|
|
554
638
|
'level.mode.work': {
|
|
555
639
|
types: ['number'],
|
|
556
640
|
read: true,
|
|
557
641
|
write: true,
|
|
558
642
|
},
|
|
643
|
+
'level.open.tilt': {
|
|
644
|
+
types: ['number'],
|
|
645
|
+
read: true,
|
|
646
|
+
write: true,
|
|
647
|
+
},
|
|
559
648
|
'level.pressure': {
|
|
560
649
|
types: ['number'],
|
|
561
650
|
read: true,
|
|
@@ -571,6 +660,11 @@ const STATE_ROLE_RULES = {
|
|
|
571
660
|
read: true,
|
|
572
661
|
write: true,
|
|
573
662
|
},
|
|
663
|
+
'level.pump': {
|
|
664
|
+
types: ['number'],
|
|
665
|
+
read: true,
|
|
666
|
+
write: true,
|
|
667
|
+
},
|
|
574
668
|
'level.setting': {
|
|
575
669
|
types: ['number'],
|
|
576
670
|
read: true,
|
|
@@ -846,6 +940,16 @@ const STATE_ROLE_RULES = {
|
|
|
846
940
|
read: true,
|
|
847
941
|
write: true,
|
|
848
942
|
},
|
|
943
|
+
'level.temperature.cooling': {
|
|
944
|
+
types: ['number'],
|
|
945
|
+
read: true,
|
|
946
|
+
write: true,
|
|
947
|
+
},
|
|
948
|
+
'level.temperature.heating': {
|
|
949
|
+
types: ['number'],
|
|
950
|
+
read: true,
|
|
951
|
+
write: true,
|
|
952
|
+
},
|
|
849
953
|
'level.tilt': {
|
|
850
954
|
types: ['number'],
|
|
851
955
|
read: true,
|
|
@@ -856,6 +960,11 @@ const STATE_ROLE_RULES = {
|
|
|
856
960
|
read: true,
|
|
857
961
|
write: true,
|
|
858
962
|
},
|
|
963
|
+
'level.timer.off': {
|
|
964
|
+
types: ['number'],
|
|
965
|
+
read: true,
|
|
966
|
+
write: true,
|
|
967
|
+
},
|
|
859
968
|
'level.timer.sleep': {
|
|
860
969
|
types: ['number'],
|
|
861
970
|
read: true,
|
|
@@ -896,6 +1005,9 @@ const STATE_ROLE_RULES = {
|
|
|
896
1005
|
read: true,
|
|
897
1006
|
write: true,
|
|
898
1007
|
},
|
|
1008
|
+
'link.camera': {
|
|
1009
|
+
types: ['string'],
|
|
1010
|
+
},
|
|
899
1011
|
list: {
|
|
900
1012
|
types: ['array'],
|
|
901
1013
|
},
|
|
@@ -941,6 +1053,12 @@ const STATE_ROLE_RULES = {
|
|
|
941
1053
|
'media.mute.group': {
|
|
942
1054
|
types: ['boolean'],
|
|
943
1055
|
},
|
|
1056
|
+
'media.player.name': {
|
|
1057
|
+
types: ['string'],
|
|
1058
|
+
},
|
|
1059
|
+
'media.player.type': {
|
|
1060
|
+
types: ['string'],
|
|
1061
|
+
},
|
|
944
1062
|
'media.playid': {},
|
|
945
1063
|
'media.playlist': {},
|
|
946
1064
|
'media.season': {
|
|
@@ -968,6 +1086,11 @@ const STATE_ROLE_RULES = {
|
|
|
968
1086
|
read: true,
|
|
969
1087
|
write: false,
|
|
970
1088
|
},
|
|
1089
|
+
'sensor.alarm.co': {
|
|
1090
|
+
types: ['boolean'],
|
|
1091
|
+
read: true,
|
|
1092
|
+
write: false,
|
|
1093
|
+
},
|
|
971
1094
|
'sensor.alarm.fire': {
|
|
972
1095
|
types: ['boolean'],
|
|
973
1096
|
read: true,
|
|
@@ -1039,6 +1162,31 @@ const STATE_ROLE_RULES = {
|
|
|
1039
1162
|
read: true,
|
|
1040
1163
|
write: true,
|
|
1041
1164
|
},
|
|
1165
|
+
'switch.boost': {
|
|
1166
|
+
types: ['boolean'],
|
|
1167
|
+
read: true,
|
|
1168
|
+
write: true,
|
|
1169
|
+
},
|
|
1170
|
+
'switch.camera.autofocus': {
|
|
1171
|
+
types: ['boolean'],
|
|
1172
|
+
read: true,
|
|
1173
|
+
write: true,
|
|
1174
|
+
},
|
|
1175
|
+
'switch.camera.autowhitebalance': {
|
|
1176
|
+
types: ['boolean'],
|
|
1177
|
+
read: true,
|
|
1178
|
+
write: true,
|
|
1179
|
+
},
|
|
1180
|
+
'switch.camera.brightness': {
|
|
1181
|
+
types: ['boolean'],
|
|
1182
|
+
read: true,
|
|
1183
|
+
write: true,
|
|
1184
|
+
},
|
|
1185
|
+
'switch.camera.nightmode': {
|
|
1186
|
+
types: ['boolean'],
|
|
1187
|
+
read: true,
|
|
1188
|
+
write: true,
|
|
1189
|
+
},
|
|
1042
1190
|
'switch.comfort': {
|
|
1043
1191
|
types: ['boolean'],
|
|
1044
1192
|
read: true,
|
|
@@ -1114,6 +1262,11 @@ const STATE_ROLE_RULES = {
|
|
|
1114
1262
|
read: true,
|
|
1115
1263
|
write: true,
|
|
1116
1264
|
},
|
|
1265
|
+
'switch.mode.swing': {
|
|
1266
|
+
types: ['boolean'],
|
|
1267
|
+
read: true,
|
|
1268
|
+
write: true,
|
|
1269
|
+
},
|
|
1117
1270
|
'switch.pause': {},
|
|
1118
1271
|
'switch.power': {
|
|
1119
1272
|
types: ['boolean'],
|
|
@@ -1121,6 +1274,11 @@ const STATE_ROLE_RULES = {
|
|
|
1121
1274
|
write: true,
|
|
1122
1275
|
},
|
|
1123
1276
|
'switch.power.zone': {},
|
|
1277
|
+
'switch.pump': {
|
|
1278
|
+
types: ['boolean'],
|
|
1279
|
+
read: true,
|
|
1280
|
+
write: true,
|
|
1281
|
+
},
|
|
1124
1282
|
'switch.setting': {},
|
|
1125
1283
|
text: {
|
|
1126
1284
|
types: ['string'],
|
|
@@ -1135,6 +1293,8 @@ const STATE_ROLE_RULES = {
|
|
|
1135
1293
|
'time.span': {
|
|
1136
1294
|
types: ['number'],
|
|
1137
1295
|
},
|
|
1296
|
+
'time.sunrise': {},
|
|
1297
|
+
'time.sunset': {},
|
|
1138
1298
|
'time.timeout': {
|
|
1139
1299
|
types: ['number'],
|
|
1140
1300
|
},
|
|
@@ -1144,6 +1304,9 @@ const STATE_ROLE_RULES = {
|
|
|
1144
1304
|
'url.cam': {},
|
|
1145
1305
|
'url.icon': {},
|
|
1146
1306
|
'url.same': {},
|
|
1307
|
+
'vacuum.map.base64': {
|
|
1308
|
+
types: ['string'],
|
|
1309
|
+
},
|
|
1147
1310
|
value: {
|
|
1148
1311
|
types: ['number'],
|
|
1149
1312
|
read: true,
|
|
@@ -1179,6 +1342,11 @@ const STATE_ROLE_RULES = {
|
|
|
1179
1342
|
read: true,
|
|
1180
1343
|
write: false,
|
|
1181
1344
|
},
|
|
1345
|
+
'value.ch2o.level': {
|
|
1346
|
+
types: ['number'],
|
|
1347
|
+
read: true,
|
|
1348
|
+
write: false,
|
|
1349
|
+
},
|
|
1182
1350
|
'value.clouds': {
|
|
1183
1351
|
types: ['number'],
|
|
1184
1352
|
read: true,
|
|
@@ -1189,11 +1357,21 @@ const STATE_ROLE_RULES = {
|
|
|
1189
1357
|
read: true,
|
|
1190
1358
|
write: false,
|
|
1191
1359
|
},
|
|
1360
|
+
'value.co.level': {
|
|
1361
|
+
types: ['number'],
|
|
1362
|
+
read: true,
|
|
1363
|
+
write: false,
|
|
1364
|
+
},
|
|
1192
1365
|
'value.co2': {
|
|
1193
1366
|
types: ['number'],
|
|
1194
1367
|
read: true,
|
|
1195
1368
|
write: false,
|
|
1196
1369
|
},
|
|
1370
|
+
'value.co2.level': {
|
|
1371
|
+
types: ['number'],
|
|
1372
|
+
read: true,
|
|
1373
|
+
write: false,
|
|
1374
|
+
},
|
|
1197
1375
|
'value.current': {
|
|
1198
1376
|
types: ['number'],
|
|
1199
1377
|
read: true,
|
|
@@ -1209,6 +1387,11 @@ const STATE_ROLE_RULES = {
|
|
|
1209
1387
|
read: true,
|
|
1210
1388
|
write: false,
|
|
1211
1389
|
},
|
|
1390
|
+
'value.dimmer': {
|
|
1391
|
+
types: ['number'],
|
|
1392
|
+
read: true,
|
|
1393
|
+
write: false,
|
|
1394
|
+
},
|
|
1212
1395
|
'value.direction': {
|
|
1213
1396
|
types: ['number'],
|
|
1214
1397
|
read: true,
|
|
@@ -1279,6 +1462,21 @@ const STATE_ROLE_RULES = {
|
|
|
1279
1462
|
read: true,
|
|
1280
1463
|
write: false,
|
|
1281
1464
|
},
|
|
1465
|
+
'value.filter': {
|
|
1466
|
+
types: ['number'],
|
|
1467
|
+
read: true,
|
|
1468
|
+
write: false,
|
|
1469
|
+
},
|
|
1470
|
+
'value.filter.carbon': {
|
|
1471
|
+
types: ['number'],
|
|
1472
|
+
read: true,
|
|
1473
|
+
write: false,
|
|
1474
|
+
},
|
|
1475
|
+
'value.flow': {
|
|
1476
|
+
types: ['number'],
|
|
1477
|
+
read: true,
|
|
1478
|
+
write: false,
|
|
1479
|
+
},
|
|
1282
1480
|
'value.frequency': {
|
|
1283
1481
|
types: ['number'],
|
|
1284
1482
|
read: true,
|
|
@@ -1359,11 +1557,21 @@ const STATE_ROLE_RULES = {
|
|
|
1359
1557
|
read: true,
|
|
1360
1558
|
write: false,
|
|
1361
1559
|
},
|
|
1560
|
+
'value.humidity.forecast.0': {
|
|
1561
|
+
types: ['number'],
|
|
1562
|
+
read: true,
|
|
1563
|
+
write: false,
|
|
1564
|
+
},
|
|
1362
1565
|
'value.humidity.max': {
|
|
1363
1566
|
types: ['number'],
|
|
1364
1567
|
read: true,
|
|
1365
1568
|
write: false,
|
|
1366
1569
|
},
|
|
1570
|
+
'value.humidity.max.forecast.0': {
|
|
1571
|
+
types: ['number'],
|
|
1572
|
+
read: true,
|
|
1573
|
+
write: false,
|
|
1574
|
+
},
|
|
1367
1575
|
'value.humidity.min': {
|
|
1368
1576
|
types: ['number'],
|
|
1369
1577
|
read: true,
|
|
@@ -1399,6 +1607,11 @@ const STATE_ROLE_RULES = {
|
|
|
1399
1607
|
read: true,
|
|
1400
1608
|
write: false,
|
|
1401
1609
|
},
|
|
1610
|
+
'value.mode.thermostat': {
|
|
1611
|
+
types: ['number'],
|
|
1612
|
+
read: true,
|
|
1613
|
+
write: false,
|
|
1614
|
+
},
|
|
1402
1615
|
'value.no': {
|
|
1403
1616
|
types: ['number'],
|
|
1404
1617
|
read: true,
|
|
@@ -1409,26 +1622,56 @@ const STATE_ROLE_RULES = {
|
|
|
1409
1622
|
read: true,
|
|
1410
1623
|
write: false,
|
|
1411
1624
|
},
|
|
1625
|
+
'value.no2.level': {
|
|
1626
|
+
types: ['number'],
|
|
1627
|
+
read: true,
|
|
1628
|
+
write: false,
|
|
1629
|
+
},
|
|
1412
1630
|
'value.o3': {
|
|
1413
1631
|
types: ['number'],
|
|
1414
1632
|
read: true,
|
|
1415
1633
|
write: false,
|
|
1416
1634
|
},
|
|
1635
|
+
'value.o3.level': {
|
|
1636
|
+
types: ['number'],
|
|
1637
|
+
read: true,
|
|
1638
|
+
write: false,
|
|
1639
|
+
},
|
|
1640
|
+
'value.open.tilt': {
|
|
1641
|
+
types: ['number'],
|
|
1642
|
+
read: true,
|
|
1643
|
+
write: false,
|
|
1644
|
+
},
|
|
1417
1645
|
'value.pm1': {
|
|
1418
1646
|
types: ['number'],
|
|
1419
1647
|
read: true,
|
|
1420
1648
|
write: false,
|
|
1421
1649
|
},
|
|
1650
|
+
'value.pm1.level': {
|
|
1651
|
+
types: ['number'],
|
|
1652
|
+
read: true,
|
|
1653
|
+
write: false,
|
|
1654
|
+
},
|
|
1422
1655
|
'value.pm10': {
|
|
1423
1656
|
types: ['number'],
|
|
1424
1657
|
read: true,
|
|
1425
1658
|
write: false,
|
|
1426
1659
|
},
|
|
1660
|
+
'value.pm10.level': {
|
|
1661
|
+
types: ['number'],
|
|
1662
|
+
read: true,
|
|
1663
|
+
write: false,
|
|
1664
|
+
},
|
|
1427
1665
|
'value.pm25': {
|
|
1428
1666
|
types: ['number'],
|
|
1429
1667
|
read: true,
|
|
1430
1668
|
write: false,
|
|
1431
1669
|
},
|
|
1670
|
+
'value.pm25.level': {
|
|
1671
|
+
types: ['number'],
|
|
1672
|
+
read: true,
|
|
1673
|
+
write: false,
|
|
1674
|
+
},
|
|
1432
1675
|
'value.position': {
|
|
1433
1676
|
types: ['number'],
|
|
1434
1677
|
read: true,
|
|
@@ -1529,6 +1772,16 @@ const STATE_ROLE_RULES = {
|
|
|
1529
1772
|
read: true,
|
|
1530
1773
|
write: false,
|
|
1531
1774
|
},
|
|
1775
|
+
'value.pressure.tendency': {
|
|
1776
|
+
types: ['string'],
|
|
1777
|
+
read: true,
|
|
1778
|
+
write: false,
|
|
1779
|
+
},
|
|
1780
|
+
'value.progress': {
|
|
1781
|
+
types: ['number'],
|
|
1782
|
+
read: true,
|
|
1783
|
+
write: false,
|
|
1784
|
+
},
|
|
1532
1785
|
'value.radiation': {
|
|
1533
1786
|
types: ['number'],
|
|
1534
1787
|
read: true,
|
|
@@ -1554,6 +1807,16 @@ const STATE_ROLE_RULES = {
|
|
|
1554
1807
|
read: true,
|
|
1555
1808
|
write: false,
|
|
1556
1809
|
},
|
|
1810
|
+
'value.rn.level': {
|
|
1811
|
+
types: ['number'],
|
|
1812
|
+
read: true,
|
|
1813
|
+
write: false,
|
|
1814
|
+
},
|
|
1815
|
+
'value.rssi': {
|
|
1816
|
+
types: ['number'],
|
|
1817
|
+
read: true,
|
|
1818
|
+
write: false,
|
|
1819
|
+
},
|
|
1557
1820
|
'value.severity': {
|
|
1558
1821
|
types: ['number'],
|
|
1559
1822
|
read: true,
|
|
@@ -1579,6 +1842,16 @@ const STATE_ROLE_RULES = {
|
|
|
1579
1842
|
read: true,
|
|
1580
1843
|
write: false,
|
|
1581
1844
|
},
|
|
1845
|
+
'value.so2': {
|
|
1846
|
+
types: ['number'],
|
|
1847
|
+
read: true,
|
|
1848
|
+
write: false,
|
|
1849
|
+
},
|
|
1850
|
+
'value.so2.level': {
|
|
1851
|
+
types: ['number'],
|
|
1852
|
+
read: true,
|
|
1853
|
+
write: false,
|
|
1854
|
+
},
|
|
1582
1855
|
'value.speed': {
|
|
1583
1856
|
types: ['number'],
|
|
1584
1857
|
read: true,
|
|
@@ -1644,6 +1917,16 @@ const STATE_ROLE_RULES = {
|
|
|
1644
1917
|
read: true,
|
|
1645
1918
|
write: false,
|
|
1646
1919
|
},
|
|
1920
|
+
'value.temperature.feelslike.forecast.0': {
|
|
1921
|
+
types: ['number'],
|
|
1922
|
+
read: true,
|
|
1923
|
+
write: false,
|
|
1924
|
+
},
|
|
1925
|
+
'value.temperature.forecast.0': {
|
|
1926
|
+
types: ['number'],
|
|
1927
|
+
read: true,
|
|
1928
|
+
write: false,
|
|
1929
|
+
},
|
|
1647
1930
|
'value.temperature.max': {
|
|
1648
1931
|
types: ['number'],
|
|
1649
1932
|
read: true,
|
|
@@ -1679,6 +1962,11 @@ const STATE_ROLE_RULES = {
|
|
|
1679
1962
|
read: true,
|
|
1680
1963
|
write: false,
|
|
1681
1964
|
},
|
|
1965
|
+
'value.temperature.windchill.forecast.0': {
|
|
1966
|
+
types: ['number'],
|
|
1967
|
+
read: true,
|
|
1968
|
+
write: false,
|
|
1969
|
+
},
|
|
1682
1970
|
'value.tilt': {
|
|
1683
1971
|
types: ['number'],
|
|
1684
1972
|
read: true,
|
|
@@ -1699,11 +1987,41 @@ const STATE_ROLE_RULES = {
|
|
|
1699
1987
|
read: true,
|
|
1700
1988
|
write: false,
|
|
1701
1989
|
},
|
|
1990
|
+
'value.tvoc.level': {
|
|
1991
|
+
types: ['number'],
|
|
1992
|
+
read: true,
|
|
1993
|
+
write: false,
|
|
1994
|
+
},
|
|
1995
|
+
'value.usage.brush': {
|
|
1996
|
+
types: ['number'],
|
|
1997
|
+
read: true,
|
|
1998
|
+
write: false,
|
|
1999
|
+
},
|
|
2000
|
+
'value.usage.brush.side': {
|
|
2001
|
+
types: ['number'],
|
|
2002
|
+
read: true,
|
|
2003
|
+
write: false,
|
|
2004
|
+
},
|
|
2005
|
+
'value.usage.filter': {
|
|
2006
|
+
types: ['number'],
|
|
2007
|
+
read: true,
|
|
2008
|
+
write: false,
|
|
2009
|
+
},
|
|
2010
|
+
'value.usage.sensors': {
|
|
2011
|
+
types: ['number'],
|
|
2012
|
+
read: true,
|
|
2013
|
+
write: false,
|
|
2014
|
+
},
|
|
1702
2015
|
'value.uv': {
|
|
1703
2016
|
types: ['number'],
|
|
1704
2017
|
read: true,
|
|
1705
2018
|
write: false,
|
|
1706
2019
|
},
|
|
2020
|
+
'value.vacuum.phase': {
|
|
2021
|
+
types: ['string'],
|
|
2022
|
+
read: true,
|
|
2023
|
+
write: false,
|
|
2024
|
+
},
|
|
1707
2025
|
'value.valve': {
|
|
1708
2026
|
types: ['number'],
|
|
1709
2027
|
read: true,
|
|
@@ -1714,6 +2032,16 @@ const STATE_ROLE_RULES = {
|
|
|
1714
2032
|
read: true,
|
|
1715
2033
|
write: false,
|
|
1716
2034
|
},
|
|
2035
|
+
'value.volume': {
|
|
2036
|
+
types: ['number'],
|
|
2037
|
+
read: true,
|
|
2038
|
+
write: false,
|
|
2039
|
+
},
|
|
2040
|
+
'value.volume.group': {
|
|
2041
|
+
types: ['number'],
|
|
2042
|
+
read: true,
|
|
2043
|
+
write: false,
|
|
2044
|
+
},
|
|
1717
2045
|
'value.warning': {
|
|
1718
2046
|
types: ['number'],
|
|
1719
2047
|
read: true,
|
|
@@ -1740,9 +2068,11 @@ const STATE_ROLE_RULES = {
|
|
|
1740
2068
|
'weather.direction.wind.forecast.0': {},
|
|
1741
2069
|
'weather.html': {},
|
|
1742
2070
|
'weather.icon': {},
|
|
2071
|
+
'weather.icon.forecast.0': {},
|
|
1743
2072
|
'weather.icon.forecast.1': {},
|
|
1744
2073
|
'weather.icon.name': {},
|
|
1745
2074
|
'weather.icon.wind': {},
|
|
2075
|
+
'weather.icon.wind.forecast.0': {},
|
|
1746
2076
|
'weather.json': {},
|
|
1747
2077
|
'weather.state': {},
|
|
1748
2078
|
'weather.state.forecast.0': {},
|
|
@@ -1754,6 +2084,7 @@ const STATE_ROLE_RULES = {
|
|
|
1754
2084
|
};
|
|
1755
2085
|
|
|
1756
2086
|
module.exports = {
|
|
2087
|
+
STATEROLES_DOC_COMMIT,
|
|
1757
2088
|
ROOT_OBJECT_SCHEMA,
|
|
1758
2089
|
ALLOWED_OBJECT_TYPES,
|
|
1759
2090
|
HIERARCHY_TYPES,
|
package/lib/objectStructure.js
CHANGED
|
@@ -37,23 +37,11 @@ const {
|
|
|
37
37
|
} = require('./config_StateRoles');
|
|
38
38
|
|
|
39
39
|
// ---------------------------------------------------------------------------
|
|
40
|
-
//
|
|
41
|
-
//
|
|
40
|
+
// Role rules used for validation. Uses the schema rules from config_StateRoles.js
|
|
41
|
+
// as-is; button roles keep their read/write constraints (read:false, write:true)
|
|
42
|
+
// so that misconfigured buttons are reported.
|
|
42
43
|
// ---------------------------------------------------------------------------
|
|
43
|
-
const ROLE_RULES =
|
|
44
|
-
// Shallow-clone each entry so we never mutate the imported config object.
|
|
45
|
-
const cloned = {};
|
|
46
|
-
for (const [role, rule] of Object.entries(STATE_ROLE_RULES)) {
|
|
47
|
-
cloned[role] = { ...rule };
|
|
48
|
-
}
|
|
49
|
-
for (const ambiguousRole of ['button', 'button.long']) {
|
|
50
|
-
if (cloned[ambiguousRole]) {
|
|
51
|
-
delete cloned[ambiguousRole].read;
|
|
52
|
-
delete cloned[ambiguousRole].write;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return cloned;
|
|
56
|
-
})();
|
|
44
|
+
const ROLE_RULES = STATE_ROLE_RULES;
|
|
57
45
|
|
|
58
46
|
const FORBIDDEN_ID_CHARS_REGEX = /[^._\-/ :!#$%&()+=@^{}|~\p{Ll}\p{Lu}\p{Nd}]+/gu;
|
|
59
47
|
const ID_SUGGESTION_REGEX = /[^a-zA-Z0-9_,-.]+/g;
|
|
@@ -213,7 +201,11 @@ function createRoleRuleMaps() {
|
|
|
213
201
|
const prefixRules = [];
|
|
214
202
|
|
|
215
203
|
for (const [role, rule] of Object.entries(ROLE_RULES)) {
|
|
216
|
-
|
|
204
|
+
// A trailing "*" (e.g. "button.mode.*") or a trailing "." marks a wildcard rule:
|
|
205
|
+
// it matches any role starting with the text before the "*"/"." (inclusive).
|
|
206
|
+
if (role.endsWith('*')) {
|
|
207
|
+
prefixRules.push({ prefix: role.slice(0, -1), rule });
|
|
208
|
+
} else if (role.endsWith('.')) {
|
|
217
209
|
prefixRules.push({ prefix: role, rule });
|
|
218
210
|
} else {
|
|
219
211
|
exactRules.set(role, rule);
|
package/package.json
CHANGED