iobroker.zigbee 1.8.3 → 1.8.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.
Files changed (87) hide show
  1. package/README.md +3 -0
  2. package/admin/admin.js +512 -493
  3. package/admin/index_m.html +1171 -1001
  4. package/admin/tab_m.html +44 -3
  5. package/docs/de/img/CC2531.png +0 -0
  6. package/docs/de/img/CC2538_CC2592_PA.PNG +0 -0
  7. package/docs/de/img/CC2591.png +0 -0
  8. package/docs/de/img/boards.jpg +0 -0
  9. package/docs/de/img/cc26x2r.PNG +0 -0
  10. package/docs/de/img/results.jpg +0 -0
  11. package/docs/de/img/sku_429478_2.png +0 -0
  12. package/docs/de/img/sku_429601_2.png +0 -0
  13. package/docs/de/readme.md +27 -0
  14. package/docs/en/img/CC2531.png +0 -0
  15. package/docs/en/img/CC2591.png +0 -0
  16. package/docs/en/img/deconz.png +0 -0
  17. package/docs/en/img/sku_429478_2.png +0 -0
  18. package/docs/en/img/sku_429601_2.png +0 -0
  19. package/docs/en/readme.md +30 -0
  20. package/docs/flashing_via_arduino_(en).md +110 -0
  21. package/docs/ru/img/CC2531.png +0 -0
  22. package/docs/ru/img/CC2591.png +0 -0
  23. package/docs/ru/img/sku_429478_2.png +0 -0
  24. package/docs/ru/img/sku_429601_2.png +0 -0
  25. package/docs/ru/readme.md +28 -0
  26. package/docs/tutorial/CC2530_20190425.zip +0 -0
  27. package/docs/tutorial/CC2530_CC2591_20190515.zip +0 -0
  28. package/docs/tutorial/CC2530_CC2592_20190515.zip +0 -0
  29. package/docs/tutorial/CC2531_20190425.zip +0 -0
  30. package/docs/tutorial/adm5_1.PNG +0 -0
  31. package/docs/tutorial/adm5_2.PNG +0 -0
  32. package/docs/tutorial/cat.PNG +0 -0
  33. package/docs/tutorial/groups-1.png +0 -0
  34. package/docs/tutorial/groups-2.png +0 -0
  35. package/docs/tutorial/inst.PNG +0 -0
  36. package/docs/tutorial/reflash-finish.PNG +0 -0
  37. package/docs/tutorial/reflash-step0.png +0 -0
  38. package/docs/tutorial/reflash-step1.PNG +0 -0
  39. package/docs/tutorial/reflash-step2.PNG +0 -0
  40. package/docs/tutorial/settings.png +0 -0
  41. package/docs/tutorial/tab-dev-1.png +0 -0
  42. package/docs/tutorial/zigbee.png +0 -0
  43. package/docs/tutorial/zigbee15.png +0 -0
  44. package/io-package.json +17 -25
  45. package/lib/backup.js +2 -2
  46. package/lib/binding.js +32 -37
  47. package/lib/colors.js +163 -158
  48. package/lib/commands.js +100 -91
  49. package/lib/developer.js +9 -12
  50. package/lib/devices.js +168 -178
  51. package/lib/exclude.js +30 -36
  52. package/lib/exposes.js +163 -139
  53. package/lib/groups.js +81 -83
  54. package/lib/json.js +5 -6
  55. package/lib/networkmap.js +2 -3
  56. package/lib/ota.js +34 -18
  57. package/lib/rgb.js +114 -72
  58. package/lib/seriallist.js +25 -20
  59. package/lib/states.js +511 -526
  60. package/lib/statescontroller.js +206 -183
  61. package/lib/utils.js +24 -23
  62. package/lib/zbBaseExtension.js +4 -4
  63. package/lib/zbDelayedAction.js +5 -13
  64. package/lib/zbDeviceAvailability.js +69 -65
  65. package/lib/zbDeviceConfigure.js +9 -21
  66. package/lib/zbDeviceEvent.js +3 -4
  67. package/lib/zigbeecontroller.js +133 -128
  68. package/main.js +169 -154
  69. package/package.json +27 -13
  70. package/.eslintignore +0 -2
  71. package/.eslintrc.json +0 -37
  72. package/.github/FUNDING.yml +0 -3
  73. package/.github/auto-merge.yml +0 -17
  74. package/.github/dependabot.yml +0 -24
  75. package/.github/stale.yml +0 -13
  76. package/.github/workflows/codeql.yml +0 -41
  77. package/.github/workflows/dependabot-automerge.yml +0 -22
  78. package/.github/workflows/test-and-release.yml +0 -149
  79. package/.releaseconfig.json +0 -3
  80. package/.travis/wiki.sh +0 -28
  81. package/.travis.yml +0 -41
  82. package/gulpfile.js +0 -464
  83. package/test/integration.js +0 -5
  84. package/test/mocha.custom.opts +0 -2
  85. package/test/mocha.setup.js +0 -14
  86. package/test/package.js +0 -5
  87. package/test/unit.js +0 -5
package/lib/devices.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const states = require(__dirname + '/states.js').states;
4
- const utils = require(__dirname + '/utils.js');
5
- const rgb = require(__dirname + '/rgb.js');
6
- const applyExposes = require(__dirname + '/exposes.js').applyExposes;
3
+ const states = require('./states.js').states;
4
+ const utils = require('./utils.js');
5
+ const rgb = require('./rgb.js');
6
+ const applyExposes = require('./exposes.js').applyExposes;
7
7
 
8
8
 
9
9
  // return list of changing states when incoming state is changed
@@ -23,7 +23,7 @@ const comb = {
23
23
  // index: -1, // before main change
24
24
  // timeout: 0,
25
25
  index: 1, // after main change
26
- timeout: timeout,
26
+ timeout,
27
27
  }];
28
28
  }
29
29
  } else if (disableQueue || options.state) {
@@ -32,7 +32,7 @@ const comb = {
32
32
  stateDesc: states.state,
33
33
  value: false,
34
34
  index: 1, // after main change
35
- timeout: timeout,
35
+ timeout,
36
36
  }];
37
37
  }
38
38
  }
@@ -42,20 +42,21 @@ const comb = {
42
42
  if (state.id === states.effect_json.id) {
43
43
  const effectjson = {};
44
44
  try {
45
- if (options.hasOwnProperty('effect_speed'))
45
+ if (options.hasOwnProperty('effect_speed')) {
46
46
  effectjson.speed = options.effect_speed;
47
- if (options.hasOwnProperty('effect_type'))
47
+ }
48
+ if (options.hasOwnProperty('effect_type')) {
48
49
  effectjson.effect = options.effect_type;
49
-
50
- if (options.hasOwnProperty('effect_colors'))
50
+ }
51
+ if (options.hasOwnProperty('effect_colors')) {
51
52
  effectjson.colors = rgb.colorsArrayFromString(options.effect_colors);
53
+ }
52
54
  // effectjson = JSON.parse(value);
53
- }
54
- catch {
55
+ } catch {
55
56
  const effectjson = {
56
- colors:[{r: 255,g: 0,b: 0},{r: 0,g: 255,b: 0},{r: 0,g: 0,b: 255}],
57
- speed:10,
58
- effect:'glow',
57
+ colors: [{r: 255, g: 0, b: 0}, {r: 0, g: 255, b: 0}, {r: 0, g: 0, b: 255}],
58
+ speed: 10,
59
+ effect: 'glow',
59
60
  };
60
61
  if (options.hasOwnProperty('effect_speed'))
61
62
  effectjson.speed = options.effect_speed;
@@ -118,11 +119,11 @@ const sync = {
118
119
  },
119
120
  };
120
121
 
121
- const lightStatesWithColortemp = [states.state, states.brightness, states.colortemp,states.brightness_move, states.colortemp_move, states.transition_time];
122
- const lightStatesWithColor = [states.state, states.brightness, states.colortemp, states.color,states.brightness_move, states.colortemp_move, states.transition_time];
123
- const lightStatesWithColor_hue = [states.state, states.brightness, states.colortemp, states.color,states.brightness_move, states.colortemp_move, states.hue_move, states.transition_time, states.effect_type_hue];
122
+ const lightStatesWithColortemp = [states.state, states.brightness, states.colortemp, states.brightness_move, states.colortemp_move, states.transition_time];
123
+ const lightStatesWithColor = [states.state, states.brightness, states.colortemp, states.color, states.brightness_move, states.colortemp_move, states.transition_time];
124
+ const lightStatesWithColor_hue = [states.state, states.brightness, states.colortemp, states.color, states.brightness_move, states.colortemp_move, states.hue_move, states.transition_time, states.effect_type_hue];
124
125
  const lightStatesWithColorNoTemp = [states.state, states.brightness, states.color, states.brightness_move, states.transition_time];
125
- const lightStates = [states.state, states.brightness, states.brightness_move, states.transition_time];
126
+ const lightStates = [states.state, states.brightness, states.brightness_move, states.transition_time];
126
127
 
127
128
  const gl_lightStatesWithColor = [states.gl_state, states.gl_brightness, states.gl_colortemp, states.gl_color, states.transition_time];
128
129
  const gl_white_channel = [states.white_brightness, states.white_state, states.white_colortemp];
@@ -131,29 +132,30 @@ const freepad_states = [states.battery];
131
132
 
132
133
  function getKey(object, value) {
133
134
  for (const key in object) {
134
- if (object[key]==value) return key;
135
+ if (object[key] == value) {
136
+ return key;
137
+ }
135
138
  }
136
139
  }
137
140
 
138
141
  const unitLookup = {
139
142
  'temperature': 'C',
140
- 'humidity':'%',
141
- 'altitude':'m',
142
- 'pressure':'Pa',
143
- 'quality':'ppm',
144
- 'particle_size':'psize',
145
- 'voltage':'V',
146
- 'current':'A',
147
- 'energy':'Wh',
148
- 'power':'W',
149
- 'frequency':'Hz',
150
- 'power_factor':'pf',
151
- 'illuminance_lux':'lx',
152
-
143
+ 'humidity': '%',
144
+ 'altitude': 'm',
145
+ 'pressure': 'Pa',
146
+ 'quality': 'ppm',
147
+ 'particle_size': 'psize',
148
+ 'voltage': 'V',
149
+ 'current': 'A',
150
+ 'energy': 'Wh',
151
+ 'power': 'W',
152
+ 'frequency': 'Hz',
153
+ 'power_factor': 'pf',
154
+ 'illuminance_lux': 'lx',
153
155
  };
154
156
 
155
157
  const generator = {
156
- gledopto: (entity) => {
158
+ gledopto: entity => {
157
159
  if (entity.mapped.model === 'GL-C-008-2ID') {
158
160
  return gl_lightStatesWithColor.concat(gl8_white_channel);
159
161
  } else if (entity.mapped.model === 'GL-C-007-2ID') {
@@ -162,87 +164,76 @@ const generator = {
162
164
  return lightStatesWithColor;
163
165
  }
164
166
  },
165
- freepad: (entity) => {
167
+ freepad: entity => {
166
168
  const freepad_st = [];
167
169
  const ecount = entity.device.endpoints.length;
168
170
  for (let i = 1; i <= ecount; i++) {
169
- freepad_st.push(
170
- {
171
- id: `btn${i}_single`,
172
- prop: 'action',
173
- name: `Button ${i} click event`,
174
- icon: undefined,
175
- role: 'button',
176
- write: false,
177
- read: true,
178
- type: 'boolean',
179
- isEvent: true,
180
- getter: payload => (payload.action === `button_${i}_single`) ? true : undefined,
181
- }
182
- );
183
- freepad_st.push(
184
- {
185
- id: `btn${i}_double`,
186
- prop: 'action',
187
- name: `Button ${i} double click event`,
188
- icon: undefined,
189
- role: 'button',
190
- write: false,
191
- read: true,
192
- type: 'boolean',
193
- isEvent: true,
194
- getter: payload => (payload.action === `button_${i}_double`) ? true : undefined,
195
- }
196
- );
197
- freepad_st.push(
198
- {
199
- id: `btn${i}_hold`,
200
- prop: 'action',
201
- name: `Button ${i} hold`,
202
- icon: undefined,
203
- role: 'button',
204
- write: false,
205
- read: true,
206
- type: 'boolean',
207
- getter: payload => (payload.action === `button_${i}_hold`) ? true : (payload.action === `button_${i}_release`) ? false : undefined,
208
- }
209
- );
210
- freepad_st.push(
211
- {
212
- id: `btn${i}_triple`,
213
- prop: 'action',
214
- name: `Button ${i} triple click event`,
215
- icon: undefined,
216
- role: 'button',
217
- write: false,
218
- read: true,
219
- type: 'boolean',
220
- isEvent: true,
221
- getter: payload => (payload.action === `button_${i}_triple`) ? true : undefined,
222
- lazy: true,
223
- }
224
- );
225
- freepad_st.push(
226
- {
227
- id: `btn${i}_quadruple`,
228
- prop: 'action',
229
- name: `Button ${i} quadruple click event`,
230
- icon: undefined,
231
- role: 'button',
232
- write: false,
233
- read: true,
234
- type: 'boolean',
235
- isEvent: true,
236
- getter: payload => (payload.action === `button_${i}_quadruple`) ? true : undefined,
237
- lazy: true,
238
- }
239
- );
240
-
171
+ freepad_st.push({
172
+ id: `btn${i}_single`,
173
+ prop: 'action',
174
+ name: `Button ${i} click event`,
175
+ icon: undefined,
176
+ role: 'button',
177
+ write: false,
178
+ read: true,
179
+ type: 'boolean',
180
+ isEvent: true,
181
+ getter: payload => (payload.action === `button_${i}_single`) ? true : undefined,
182
+ });
183
+ freepad_st.push({
184
+ id: `btn${i}_double`,
185
+ prop: 'action',
186
+ name: `Button ${i} double click event`,
187
+ icon: undefined,
188
+ role: 'button',
189
+ write: false,
190
+ read: true,
191
+ type: 'boolean',
192
+ isEvent: true,
193
+ getter: payload => (payload.action === `button_${i}_double`) ? true : undefined,
194
+ });
195
+ freepad_st.push({
196
+ id: `btn${i}_hold`,
197
+ prop: 'action',
198
+ name: `Button ${i} hold`,
199
+ icon: undefined,
200
+ role: 'button',
201
+ write: false,
202
+ read: true,
203
+ type: 'boolean',
204
+ getter: payload => (payload.action === `button_${i}_hold`) ? true : (payload.action === `button_${i}_release`) ? false : undefined,
205
+ });
206
+ freepad_st.push({
207
+ id: `btn${i}_triple`,
208
+ prop: 'action',
209
+ name: `Button ${i} triple click event`,
210
+ icon: undefined,
211
+ role: 'button',
212
+ write: false,
213
+ read: true,
214
+ type: 'boolean',
215
+ isEvent: true,
216
+ getter: payload => (payload.action === `button_${i}_triple`) ? true : undefined,
217
+ lazy: true,
218
+ });
219
+ freepad_st.push({
220
+ id: `btn${i}_quadruple`,
221
+ prop: 'action',
222
+ name: `Button ${i} quadruple click event`,
223
+ icon: undefined,
224
+ role: 'button',
225
+ write: false,
226
+ read: true,
227
+ type: 'boolean',
228
+ isEvent: true,
229
+ getter: payload => (payload.action === `button_${i}_quadruple`) ? true : undefined,
230
+ lazy: true,
231
+ });
241
232
  }
242
233
  return freepad_states.concat(freepad_st);
243
234
  },
244
- ptvo_switch_channels: (entity) =>{
245
- const devstates = [states.ptvo_trigger,states.ptvo_interval];
235
+ ptvo_switch_channels: entity => {
236
+ const devstates = [states.ptvo_trigger, states.ptvo_interval];
246
237
  for (const endpoint of entity.device.endpoints) {
247
238
  const epID = endpoint.ID;
248
239
  const epName = getKey(entity.mapped.endpoint(entity.device), epID);
@@ -268,8 +259,10 @@ const generator = {
268
259
  // l7:l7=143voltage_l7=143
269
260
 
270
261
  if (payload.hasOwnProperty(`device_${epName}`)) {
271
- id = (typeof(payload[`device_${epName}`]) == 'string' ? payload[`device_${epName}`].replace(/[-. ]/g, ''):'unset');
272
- } else if (payload.hasOwnProperty(`voltage_${epName}`)) id = 'voltage';
262
+ id = (typeof payload[`device_${epName}`] === 'string' ? payload[`device_${epName}`].replace(/[-. ]/g, '') : 'unset');
263
+ } else if (payload.hasOwnProperty(`voltage_${epName}`)) {
264
+ id = 'voltage';
265
+ }
273
266
  let unit = undefined;
274
267
  let measurement = undefined;
275
268
  for (const item in payload) {
@@ -283,12 +276,13 @@ const generator = {
283
276
  }
284
277
  }
285
278
  }
286
- if (measurement && id != 'voltage')
287
- rv.stateid = id + '_'+measurement;
288
- else
279
+ if (measurement && id !== 'voltage') {
280
+ rv.stateid = `${id}_${measurement}`;
281
+ } else {
289
282
  rv.stateid = id;
283
+ }
290
284
  rv.value = payload[epName];
291
- rv.name = (measurement? measurement + ' 0x'+ id: '0x'+id);
285
+ rv.name = measurement ? `${measurement} 0x${id}` : `0x${id}`;
292
286
  rv.unit = unit;
293
287
  rv.role = measurement;
294
288
 
@@ -306,8 +300,8 @@ const generator = {
306
300
  write: true,
307
301
  read: true,
308
302
  type: 'boolean',
309
- getter: payload => (payload[`state_${epName}`] === 'ON'),
310
- setter: (value) => (value) ? 'ON' : 'OFF',
303
+ getter: payload => payload[`state_${epName}`] === 'ON',
304
+ setter: value => value ? 'ON' : 'OFF',
311
305
  epname: epName,
312
306
  setattr: 'state',
313
307
  });
@@ -323,7 +317,7 @@ const generator = {
323
317
  read: true,
324
318
  type: 'boolean',
325
319
  isEvent: true,
326
- getter: payload => (payload.action === `single_${epName}`) ? true : undefined,
320
+ getter: payload => payload.action === `single_${epName}` ? true : undefined,
327
321
  });
328
322
  devstates.push({
329
323
  id: `channel_${epID}.double`,
@@ -335,7 +329,7 @@ const generator = {
335
329
  read: true,
336
330
  type: 'boolean',
337
331
  isEvent: true,
338
- getter: payload => (payload.action === `double_${epName}`) ? true : undefined,
332
+ getter: payload => payload.action === `double_${epName}` ? true : undefined,
339
333
  });
340
334
  devstates.push({
341
335
  id: `channel_${epID}.tripple`,
@@ -347,7 +341,7 @@ const generator = {
347
341
  read: true,
348
342
  type: 'boolean',
349
343
  isEvent: true,
350
- getter: payload => (payload.action === `tripple_${epName}`) ? true : undefined,
344
+ getter: payload => payload.action === `tripple_${epName}` ? true : undefined,
351
345
  });
352
346
  }
353
347
  if (endpoint.supportsOutputCluster('genLevelCtrl')) {
@@ -362,12 +356,8 @@ const generator = {
362
356
  unit: '',
363
357
  min: 0,
364
358
  max: 100,
365
- getter: payload => {
366
- return utils.bulbLevelToAdapterLevel(payload[`brightness_${epName}`]);
367
- },
368
- setter: (value) => {
369
- return utils.adapterLevelToBulbLevel(value);
370
- },
359
+ getter: payload => utils.bulbLevelToAdapterLevel(payload[`brightness_${epName}`]),
360
+ setter: value => utils.adapterLevelToBulbLevel(value),
371
361
  epname: epName,
372
362
  setattr: 'brightness',
373
363
  });
@@ -386,9 +376,7 @@ const generator = {
386
376
  getter: payload => { //l3=0 brightness_l3=0
387
377
  return payload[`${epName}`]; //return payload[`brightness_${epName}`];
388
378
  },
389
- setter: (value) => {
390
- return value;
391
- },
379
+ setter: value => value,
392
380
  epname: epName
393
381
  });
394
382
  }
@@ -438,9 +426,15 @@ const generator = {
438
426
  read: true,
439
427
  type: 'boolean',
440
428
  getter: payload => {
441
- if ((payload.action_group % ecount) != (epidx % ecount)) return undefined;
442
- if (payload.action == 'brightness_move_up') return true;
443
- if (payload.action == 'brightness_stop') return false;
429
+ if ((payload.action_group % ecount) != (epidx % ecount)) {
430
+ return undefined;
431
+ }
432
+ if (payload.action === 'brightness_move_up') {
433
+ return true;
434
+ }
435
+ if (payload.action === 'brightness_stop') {
436
+ return false;
437
+ }
444
438
  return undefined;
445
439
  },
446
440
  });
@@ -454,9 +448,15 @@ const generator = {
454
448
  read: true,
455
449
  type: 'boolean',
456
450
  getter: payload => {
457
- if ((payload.action_group % ecount) != (epidx % ecount)) return undefined;
458
- if (payload.action == 'brightness_move_down') return true;
459
- if (payload.action == 'brightness_stop') return false;
451
+ if ((payload.action_group % ecount) != (epidx % ecount)) {
452
+ return undefined;
453
+ }
454
+ if (payload.action === 'brightness_move_down') {
455
+ return true;
456
+ }
457
+ if (payload.action === 'brightness_stop') {
458
+ return false;
459
+ }
460
460
  return undefined;
461
461
  },
462
462
  });
@@ -502,8 +502,8 @@ const generator = {
502
502
  write: true,
503
503
  read: true,
504
504
  type: 'boolean',
505
- getter: payload => (payload[`state_${epName}`] === 'ON'),
506
- setter: (value) => (value) ? 'ON' : 'OFF',
505
+ getter: payload => payload[`state_${epName}`] === 'ON',
506
+ setter: value => value ? 'ON' : 'OFF',
507
507
  epname: epName,
508
508
  setattr: 'state',
509
509
  });
@@ -519,7 +519,7 @@ const generator = {
519
519
  read: true,
520
520
  type: 'boolean',
521
521
  isEvent: true,
522
- getter: payload => (payload.action === `single_${epName}`) ? true : undefined,
522
+ getter: payload => payload.action === `single_${epName}` ? true : undefined,
523
523
  });
524
524
  devstates.push({
525
525
  id: `btn_${epID}_double`,
@@ -531,7 +531,7 @@ const generator = {
531
531
  read: true,
532
532
  type: 'boolean',
533
533
  isEvent: true,
534
- getter: payload => (payload.action === `double_${epName}`) ? true : undefined,
534
+ getter: payload => payload.action === `double_${epName}` ? true : undefined,
535
535
  });
536
536
  devstates.push({
537
537
  id: `btn_${epID}_tripple`,
@@ -543,7 +543,7 @@ const generator = {
543
543
  read: true,
544
544
  type: 'boolean',
545
545
  isEvent: true,
546
- getter: payload => (payload.action === `tripple_${epName}`) ? true : undefined,
546
+ getter: payload => payload.action === `tripple_${epName}` ? true : undefined,
547
547
  });
548
548
  }
549
549
  if (endpoint.supportsOutputCluster('genLevelCtrl')) {
@@ -558,12 +558,8 @@ const generator = {
558
558
  unit: '',
559
559
  min: 0,
560
560
  max: 100,
561
- getter: payload => {
562
- return utils.bulbLevelToAdapterLevel(payload[`brightness_${epName}`]);
563
- },
564
- setter: (value) => {
565
- return utils.adapterLevelToBulbLevel(value);
566
- },
561
+ getter: payload => utils.bulbLevelToAdapterLevel(payload[`brightness_${epName}`]),
562
+ setter: value => utils.adapterLevelToBulbLevel(value),
567
563
  epname: epName,
568
564
  setattr: 'brightness',
569
565
  });
@@ -573,13 +569,13 @@ const generator = {
573
569
  },
574
570
  };
575
571
 
576
- function states_with_epname (entity, states) {
572
+ function states_with_epname(entity, states) {
577
573
  const devstates = [];
578
574
  for (const endpoint of entity.device.endpoints) {
579
575
  const epID = endpoint.ID;
580
576
  const epName = getKey(entity.mapped.endpoint(entity.device), epID);
581
577
  for (const state of states) {
582
- const newState = { ...state };
578
+ const newState = {...state};
583
579
  newState.id = `${newState.id}_${epName}`;
584
580
  if (newState.name) newState.name = `${newState.name} (${epName})`;
585
581
  if (newState.prop) newState.prop = `${newState.prop}_${epName}`;
@@ -626,7 +622,7 @@ const devices = [
626
622
  ],
627
623
  },
628
624
  {
629
- models: ['WXKG03LM','WXKG03LM_rev2'],
625
+ models: ['WXKG03LM', 'WXKG03LM_rev2'],
630
626
  icon: 'img/86sw1.png',
631
627
  states: [
632
628
  states.click, states.double_click, states.voltage, states.battery,
@@ -642,7 +638,7 @@ const devices = [
642
638
  ],
643
639
  },
644
640
  {
645
- models: ['WXKG02LM','WXKG02LM_rev2'],
641
+ models: ['WXKG02LM', 'WXKG02LM_rev2'],
646
642
  icon: 'img/86sw2.png',
647
643
  states: [
648
644
  states.left_click, states.right_click, states.both_click,
@@ -824,7 +820,7 @@ const devices = [
824
820
  models: ['ZNCLDJ11LM'],
825
821
  icon: 'img/aqara_curtain.png',
826
822
  states: [states.curtain_position, states.curtain_running, states.curtain_stop, states.curtain_xiaomi_reverse_direction,
827
- states.curtain_xiaomi_reset_limits, states.curtain_xiaomi_hand_open],
823
+ states.curtain_xiaomi_reset_limits, states.curtain_xiaomi_hand_open],
828
824
  },
829
825
  {
830
826
  models: ['WXCJKG11LM'],
@@ -999,7 +995,7 @@ const devices = [
999
995
  states: [states.occupancy, states.temperature, states.temp_calibration],
1000
996
  },
1001
997
  {
1002
- models: ['595UGR22','4058075181472'],
998
+ models: ['595UGR22', '4058075181472'],
1003
999
  icon: 'img/FLOALT.panel.WS.png',
1004
1000
  states: lightStatesWithColortemp,
1005
1001
  syncStates: [sync.brightness],
@@ -1172,7 +1168,7 @@ const devices = [
1172
1168
  syncStates: [sync.brightness],
1173
1169
  },
1174
1170
  {
1175
- models: ['5055131P7','5055148P7'],
1171
+ models: ['5055131P7', '5055148P7'],
1176
1172
  icon: 'img/philips_hue_centura_square.png',
1177
1173
  states: lightStatesWithColor_hue,
1178
1174
  syncStates: [sync.brightness],
@@ -1494,7 +1490,7 @@ const devices = [
1494
1490
  {
1495
1491
  models: ['E1757', 'E1926'],
1496
1492
  states: [states.battery, states.blind_position, states.blind_open, states.blind_close, states.blind_stop],
1497
- icon: 'img/Ikea_fyrtur.png',
1493
+ icon: 'img/Ikea_fyrtur.png',
1498
1494
  },
1499
1495
  {
1500
1496
  models: ['ICPSHC24-10EU-IL-1', 'ICPSHC24-30EU-IL-1'],
@@ -1516,7 +1512,7 @@ const devices = [
1516
1512
  {
1517
1513
  models: ['E1744'],
1518
1514
  icon: 'img/ikea_SYMFONISK_Sound_Controller.png',
1519
- states: [states.button_action_skip_back, states.button_action_skip_forward, states.action_play_pause,
1515
+ states: [states.button_action_skip_back, states.button_action_skip_forward, states.action_play_pause,
1520
1516
  states.rotate_left, states.rotate_right, states.rotate_stop, states.battery],
1521
1517
  },
1522
1518
  // Hive
@@ -1615,7 +1611,7 @@ const devices = [
1615
1611
  {
1616
1612
  models: ['SP 120', 'SP 220', 'SP 222', 'SP 224'],
1617
1613
  icon: 'img/innr_plug.png',
1618
- states: [states.state,states.load_power],
1614
+ states: [states.state, states.load_power],
1619
1615
  },
1620
1616
  {
1621
1617
  models: ['FL 130 C'],
@@ -1922,7 +1918,7 @@ const devices = [
1922
1918
  syncStates: [sync.brightness],
1923
1919
  },
1924
1920
  {
1925
- models: ['798.09','371000002'],
1921
+ models: ['798.09', '371000002'],
1926
1922
  icon: 'img/Paulmann_79809.png',
1927
1923
  states: lightStatesWithColor,
1928
1924
  syncStates: [sync.brightness],
@@ -1942,7 +1938,7 @@ const devices = [
1942
1938
  states.brightness_move_down, states.brightness_move_down_size,
1943
1939
  states.enhanced_move_to_hue_and_saturation, states.enhanced_move_enhanced_hue,
1944
1940
  states.enhanced_move_hue, states.enhanced_move_saturation,
1945
- states.scene,states.action_group
1941
+ states.scene, states.action_group,
1946
1942
  ],
1947
1943
  },
1948
1944
 
@@ -2095,7 +2091,7 @@ const devices = [
2095
2091
  linkedStates: [comb.brightnessAndState],
2096
2092
  },
2097
2093
  {
2098
- models: ['MLI-404011','MLI-404049','MLI-404011/MLI-404049'],
2094
+ models: ['MLI-404011', 'MLI-404049', 'MLI-404011/MLI-404049'],
2099
2095
  icon: 'img/MLI-404011-MLI-404049.png',
2100
2096
  states: [
2101
2097
  states.tint404011_scene_sunset, states.tint404011_scene_party,
@@ -2232,7 +2228,7 @@ const devices = [
2232
2228
  {
2233
2229
  models: ['07048L'],
2234
2230
  icon: 'img/innr_plug.png',
2235
- states: [states.state,states.load_power],
2231
+ states: [states.state, states.load_power],
2236
2232
  },
2237
2233
  {
2238
2234
  models: ['AV2010/32'],
@@ -2408,12 +2404,12 @@ const devices = [
2408
2404
  states: [states.state],
2409
2405
  },
2410
2406
  {
2411
- models: [ 'X712A'],
2407
+ models: ['X712A'],
2412
2408
  icon: 'img/tuya_switch_2.png',
2413
2409
  states: [states.l1, states.l2],
2414
2410
  },
2415
2411
  {
2416
- models: [ 'X713A'],
2412
+ models: ['X713A'],
2417
2413
  icon: 'img/tuya_switch_3.png',
2418
2414
  states: [states.l1, states.l2, states.l3],
2419
2415
  },
@@ -2557,7 +2553,7 @@ const devices = [
2557
2553
  ],
2558
2554
  },
2559
2555
  {
2560
- models: ['SEA802-Zigbee','SEA801-Zigbee/SEA802-Zigbee'],
2556
+ models: ['SEA802-Zigbee', 'SEA801-Zigbee/SEA802-Zigbee'],
2561
2557
  icon: 'img/tuya_TS0601.png',
2562
2558
  states: [
2563
2559
  states.child_lock,
@@ -3044,7 +3040,7 @@ const devices = [
3044
3040
  states: generator.icasa_remote,
3045
3041
  },
3046
3042
 
3047
- /* images only for admin */
3043
+ /* ------------ images only for admin ------------------- */
3048
3044
  {
3049
3045
  models: ['E1812'],
3050
3046
  icon: 'img/ikea_E1812.png',
@@ -3075,13 +3071,12 @@ const devices = [
3075
3071
  },
3076
3072
  {
3077
3073
  models: ['TI0001-cover'],
3078
- icon: 'img/TI0001-cover.png',
3074
+ icon: 'img/TI0001-cover.png',
3079
3075
  },
3080
3076
  {
3081
3077
  models: ['E1603/E1702/E1708'],
3082
3078
  icon: 'img/ikea_control_outlet.png',
3083
3079
  },
3084
-
3085
3080
  ];
3086
3081
 
3087
3082
  const commonStates = [
@@ -3094,11 +3089,10 @@ const commonStates = [
3094
3089
 
3095
3090
  const groupStates = [states.brightness_step].concat(lightStatesWithColor);
3096
3091
 
3097
-
3098
3092
  function getByModel() {
3099
3093
  const byModel = new Map();
3100
3094
  for (const device of devices) {
3101
- for (const model of device.models) {
3095
+ for (const model of device.models) {
3102
3096
  const stripModel = model.replace(/\0.*$/g, '').trim();
3103
3097
  byModel.set(stripModel, device);
3104
3098
  }
@@ -3114,32 +3108,28 @@ function fillStatesWithExposes(allExcludesObj) {
3114
3108
  applyExposes(devices, byModel, allExcludesObj);
3115
3109
 
3116
3110
  removeEmptyStates(devices);
3117
-
3118
3111
  }
3119
3112
 
3120
3113
  // remove empty states
3121
3114
  function removeEmptyStates(devices) {
3122
3115
  for (const device of devices) {
3123
3116
  if (Array.isArray(device.states)) {
3124
- device.states = device.states.filter((el) => el !== undefined);
3117
+ device.states = device.states.filter(el => el !== undefined);
3125
3118
  }
3126
3119
  }
3127
3120
  }
3128
3121
 
3129
-
3130
3122
  function findModel(model) {
3131
3123
  const byModel = getByModel();
3132
3124
  const stripModel = (model) ? model.replace(/\0.*$/g, '').trim() : '';
3133
3125
  return byModel.get(stripModel);
3134
3126
  }
3135
3127
 
3136
-
3137
-
3138
3128
  module.exports = {
3139
- devices: devices,
3140
- commonStates: commonStates,
3141
- groupStates: groupStates,
3129
+ devices,
3130
+ commonStates,
3131
+ groupStates,
3142
3132
  groupsState: states.groups,
3143
- fillStatesWithExposes: fillStatesWithExposes,
3144
- findModel: findModel
3133
+ fillStatesWithExposes,
3134
+ findModel,
3145
3135
  };