iobroker.zigbee 1.10.3 → 1.10.12

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/admin/admin.js CHANGED
@@ -15,7 +15,7 @@ let devices = [],
15
15
  networkEvents,
16
16
  responseCodes = false,
17
17
  groups = {},
18
- devGroups = {},
18
+ devGroups = {}, // eslint-disable-line prefer-const
19
19
  binding = [],
20
20
  excludes = [],
21
21
  coordinatorinfo = {
@@ -29,9 +29,25 @@ let devices = [],
29
29
  shuffleInstance;
30
30
  const updateCardInterval = setInterval(updateCardTimer, 6000);
31
31
 
32
+ const networkOptions = {
33
+ autoResize: true,
34
+ height: '100%',
35
+ width: '100%',
36
+ nodes: {
37
+ shape: 'box'
38
+ },
39
+ layout: {
40
+ improvedLayout: true,
41
+ },
42
+ physics: {
43
+ enabled: true,
44
+ }
45
+ };
46
+
47
+
32
48
  const savedSettings = [
33
49
  'port', 'panID', 'channel', 'disableLed', 'countDown', 'groups', 'extPanID', 'precfgkey', 'transmitPower',
34
- 'adapterType', 'debugHerdsman', 'disableBackup', 'disablePing', 'external', 'startWithInconsistent', 'warnOnDeviceAnnouncement', 'baudRate'
50
+ 'adapterType', 'debugHerdsman', 'disableBackup', 'disablePing', 'external', 'startWithInconsistent', 'warnOnDeviceAnnouncement', 'baudRate', 'flowCTRL'
35
51
  ];
36
52
 
37
53
  function getDeviceByID(ID) {
@@ -54,7 +70,7 @@ function getDevice(ieeeAddr) {
54
70
  });
55
71
  }
56
72
 
57
- // eslint-disable-next-line no-unused-vars
73
+
58
74
  function getDeviceByNetwork(nwk) {
59
75
  return devices.find((devInfo) => {
60
76
  try {
@@ -276,7 +292,6 @@ function getCard(dev) {
276
292
  </div>`;
277
293
  return card;
278
294
  }
279
-
280
295
  /*
281
296
  function openReval(e, id, name){
282
297
  const $card = $(e.target).closest('.card');
@@ -369,7 +384,6 @@ function editName(id, name) {
369
384
  console.log('editName called with ' + name);
370
385
  const dev = devices.find((d) => d._id == id);
371
386
  $('#modaledit').find('input[id=\'d_name\']').val(name);
372
- // if (dev.info && dev.info.device._type == 'Router') {
373
387
  const groupables = [];
374
388
  if (dev && dev.info && dev.info.endpoints) {
375
389
  for (const ep of dev.info.endpoints) {
@@ -379,11 +393,13 @@ function editName(id, name) {
379
393
  }
380
394
  }
381
395
  const numEP = groupables.length;
382
- // console.log('groupables: '+JSON.stringify(groupables));
383
396
  $('#modaledit').find('.row.epid0').addClass('hide');
384
397
  $('#modaledit').find('.row.epid1').addClass('hide');
385
398
  $('#modaledit').find('.row.epid2').addClass('hide');
386
399
  $('#modaledit').find('.row.epid3').addClass('hide');
400
+ $('#modaledit').find('.row.epid4').addClass('hide');
401
+ $('#modaledit').find('.row.epid5').addClass('hide');
402
+ $('#modaledit').find('.row.epid6').addClass('hide');
387
403
  if (numEP > 0) {
388
404
  // go through all the groups. Find the ones to list for each groupable
389
405
  if (numEP == 1) {
@@ -396,7 +412,7 @@ function editName(id, name) {
396
412
  if (d.hasOwnProperty('memberinfo')) {
397
413
  for (const member of d.memberinfo) {
398
414
  const epid = EndPointIDfromEndPoint(member.ep);
399
- for (var i = 0; i < groupables.length; i++) {
415
+ for (let i = 0; i < groupables.length; i++) {
400
416
  if (groupables[i].epid == epid) {
401
417
  groupables[i].memberOf.push(d.native.id.replace('group_', ''));
402
418
  }
@@ -406,7 +422,7 @@ function editName(id, name) {
406
422
  }
407
423
  }
408
424
  console.log('groupables: ' + JSON.stringify(groupables));
409
- for (var i = 0; i < groupables.length; i++) {
425
+ for (let i = 0; i < groupables.length; i++) {
410
426
  if (i > 1) {
411
427
  $('#modaledit').find('translate.device_with_endpoint').innerHtml = name + ' ' + groupables[i].epid;
412
428
  }
@@ -414,16 +430,12 @@ function editName(id, name) {
414
430
  list2select('#d_groups_ep' + i, groups, groupables[i].memberOf || []);
415
431
  }
416
432
  }
417
- // } else {
418
- // $('#modaledit').find('.input-field.endpoints').addClass('hide');
419
- // $('#modaledit').find('.input-field.groups').addClass('hide');
420
- // }
421
433
  $('#modaledit a.btn[name=\'save\']').unbind('click');
422
434
  $('#modaledit a.btn[name=\'save\']').click(() => {
423
435
  const newName = $('#modaledit').find('input[id=\'d_name\']').val();
424
436
  const groupsbyid = {};
425
437
  if (groupables.length > 0) {
426
- for (var i = 0; i < groupables.length; i++) {
438
+ for (let i = 0; i < groupables.length; i++) {
427
439
  const ng = $('#d_groups_ep' + i).val();
428
440
  if (ng.toString() != groupables[i].memberOf.toString())
429
441
  groupsbyid[groupables[i].ep.ID] = GenerateGroupChange(groupables[i].memberOf, ng);
@@ -437,7 +449,7 @@ function editName(id, name) {
437
449
  }
438
450
 
439
451
  function GenerateGroupChange(oldmembers, newmembers) {
440
- let grpchng = [];
452
+ const grpchng = [];
441
453
  for (const oldg of oldmembers)
442
454
  if (!newmembers.includes(oldg)) grpchng.push('-' + oldg);
443
455
  for (const newg of newmembers)
@@ -533,7 +545,7 @@ function showDevices() {
533
545
  } else {
534
546
  //if (d.groups && d.info && d.info.device._type == "Router") {
535
547
  if (d.groups) {
536
- // devGroups[d._id] = d.groups;
548
+ //devGroups[d._id] = d.groups;
537
549
  if (typeof d.groups.map == 'function') {
538
550
  d.groupNames = d.groups.map(item => {
539
551
  return groups[item] || '';
@@ -560,9 +572,11 @@ function showDevices() {
560
572
  const roomSelector = $('#room-filter');
561
573
  roomSelector.empty();
562
574
  roomSelector.append(`<li class="device-order-item" data-type="All" tabindex="0"><a class="translate" data-lang="All">All</a></li>`);
563
- allRooms.forEach((item) => {
564
- roomSelector.append(`<li class="device-order-item" data-type="${item}" tabindex="0"><a class="translate" data-lang="${item}">${item}</a></li>`);
565
- });
575
+ Array.from(allRooms)
576
+ .sort()
577
+ .forEach((item) => {
578
+ roomSelector.append(`<li class="device-order-item" data-type="${item}" tabindex="0"><a class="translate" data-lang="${item}">${item}</a></li>`);
579
+ });
566
580
  $('#room-filter a').click(function () {
567
581
  $('#room-filter-btn').text($(this).text());
568
582
  doFilter();
@@ -694,7 +708,7 @@ function letsPairingWithCode(code) {
694
708
  showMessage(msg.error, _('Error'));
695
709
  }
696
710
  else {
697
- showPairingProcess();
711
+ showPairingProcess();
698
712
  }
699
713
  });
700
714
  }
@@ -781,7 +795,7 @@ function getMap() {
781
795
  }
782
796
 
783
797
  // the function loadSettings has to exist ...
784
- // eslint-disable-next-line no-unused-vars
798
+
785
799
  function load(settings, onChange) {
786
800
  if (settings.panID === undefined) {
787
801
  settings.panID = 6754;
@@ -889,13 +903,13 @@ function load(settings, onChange) {
889
903
  });
890
904
 
891
905
  $('#code_pairing').click(function () {
892
- if (!$('#pairing').hasClass('pulse')) {
893
- $('#codeentry a.btn[name=\'pair\']').click(() => {
894
- const code = $('#codeentry').find('input[id=\'qr_code\']').val();
895
- letsPairingWithCode(code)
896
- });
897
- $('#codeentry').modal('open');
898
- }
906
+ if (!$('#pairing').hasClass('pulse')) {
907
+ $('#codeentry a.btn[name=\'pair\']').click(() => {
908
+ const code = $('#codeentry').find('input[id=\'qr_code\']').val();
909
+ letsPairingWithCode(code)
910
+ });
911
+ $('#codeentry').modal('open');
912
+ }
899
913
  });
900
914
 
901
915
  $(document).ready(function () {
@@ -914,6 +928,10 @@ function load(settings, onChange) {
914
928
  $('#device-order-btn').text($(this).text());
915
929
  doSort();
916
930
  });
931
+ $('#device-filter a').click(function () {
932
+ $('#device-filter-btn').text($(this).text());
933
+ doFilter();
934
+ });
917
935
  });
918
936
 
919
937
  const text = $('#pairing').attr('data-tooltip');
@@ -966,9 +984,8 @@ function showPairingProcess() {
966
984
 
967
985
  // ... and the function save has to exist.
968
986
  // you have to make sure the callback is called with the settings object as first param!
969
- // eslint-disable-next-line no-unused-vars
987
+
970
988
  function save(callback) {
971
- // example: select elements with class=value and build settings object
972
989
  const obj = {};
973
990
  $('.value').each(function () {
974
991
  const $this = $(this);
@@ -1098,13 +1115,13 @@ function showNetworkMap(devices, map) {
1098
1115
  const edges = [];
1099
1116
 
1100
1117
  if (map.lqis == undefined || map.lqis.length === 0) { // first init
1101
- $('#filterParent, #filterSibl, #filterPrvChild, #filterMesh').change(function () {
1118
+ $('#filterParent, #filterSibl, #filterPrvChild, #filterMesh, #physicsOn').change(function () {
1102
1119
  updateMapFilter();
1103
1120
  });
1104
1121
  }
1105
1122
 
1106
1123
  const createNode = function (dev, mapEntry) {
1107
- if (dev.common && dev.common.type == 'group') return undefined;
1124
+ if (dev.common && (dev.common.type == 'group' || dev.common.deactivated)) return undefined;
1108
1125
  const extInfo = (mapEntry && mapEntry.networkAddress) ? `\n (nwkAddr: 0x${mapEntry.networkAddress.toString(16)} | ${mapEntry.networkAddress})` : '';
1109
1126
  const node = {
1110
1127
  id: dev._id,
@@ -1295,19 +1312,8 @@ function showNetworkMap(devices, map) {
1295
1312
  nodes: nodesArray,
1296
1313
  edges: mapEdges
1297
1314
  };
1298
- const options = {
1299
- autoResize: true,
1300
- height: '100%',
1301
- width: '100%',
1302
- nodes: {
1303
- shape: 'box'
1304
- },
1305
- layout: {
1306
- improvedLayout: true,
1307
- }
1308
- };
1309
1315
 
1310
- network = new vis.Network(container, data, options);
1316
+ network = new vis.Network(container, data, networkOptions);
1311
1317
 
1312
1318
  const onMapSelect = function (event) {
1313
1319
  // workaround for https://github.com/almende/vis/issues/4112
@@ -1405,6 +1411,8 @@ function updateMapFilter() {
1405
1411
  const showSibl = $('#filterSibl').is(':checked');
1406
1412
  const showPrvChild = $('#filterPrvChild').is(':checked');
1407
1413
  const invisColor = $('#filterMesh').is(':checked') ? 0.2 : 0;
1414
+ networkOptions.physics.enabled = $('#physicsOn').is(':checked');
1415
+ network.setOptions(networkOptions);
1408
1416
  mapEdges.forEach((edge) => {
1409
1417
  if (((edge.relationship === 0 || edge.relationship === 1) && showParent)
1410
1418
  || (edge.relationship === 2 && showSibl)
@@ -2746,7 +2754,8 @@ function doFilter(inputText) {
2746
2754
  const lang = systemLang || 'en';
2747
2755
  const searchText = inputText || $('#device-search').val();
2748
2756
  const roomFilter = $('#room-filter-btn').text().toLowerCase();
2749
- if (searchText || roomFilter !== 'all') {
2757
+ const deviceFilter = $('#device-filter-btn').text().toLowerCase();
2758
+ if (searchText || roomFilter !== 'all' || deviceFilter != 'all') {
2750
2759
  shuffleInstance.filter(function (element, shuffle) {
2751
2760
  const devId = element.getAttribute('id');
2752
2761
  const dev = getDeviceByID(devId);
@@ -2770,6 +2779,29 @@ function doFilter(inputText) {
2770
2779
  valid = false;
2771
2780
  }
2772
2781
  }
2782
+ if (valid && dev && deviceFilter !== 'all') {
2783
+ switch (deviceFilter) {
2784
+ case 'connected':
2785
+ valid = (dev.link_quality > 0) && !dev.common.deactivated;
2786
+ break;
2787
+ case 'disconnected':
2788
+ valid = (dev.link_quality <= 0) && !dev.common.deactivated;
2789
+ break;
2790
+ case 'deactivated':
2791
+ valid = dev.common.deactivated;
2792
+ break;
2793
+ case 'router':
2794
+ valid = dev.battery == null;
2795
+ break;
2796
+ case 'enddevice':
2797
+ valid = dev.battery && dev.battery>0;
2798
+ break;
2799
+ case 'group':
2800
+ valid = (dev.common.type == 'group');
2801
+ break;
2802
+ default: valid = true;
2803
+ }
2804
+ }
2773
2805
  return valid;
2774
2806
  });
2775
2807
  } else {
@@ -50,7 +50,7 @@
50
50
  "Read Firmware": "Firmware lesen",
51
51
  "Refresh": "Aktualisieren",
52
52
  "Rename device": "Gerät umbenennen",
53
- "Reset Info": "Ein Soft-Reset startet nur den CC253x Adapter und die zugehörige Software neu. Ein Hard-Reset setzt die Liste ALLER gekoppelten Geräte und die CC253x Einstellungen zurück! Alle Geräte müssen anschließend neu gekoppelt werden!",
53
+ "Reset Info": "Ein Soft-Reset startet den Coordinator und den Adapter neu. Ein Hard-Reset setzt die Liste ALLER gekoppelten Geräte und den Coordinator zurück! Alle Geräte müssen anschließend neu gekoppelt werden!",
54
54
  "Reset confirmation": "Reset bestätigen",
55
55
  "Reset...": "Zurücksetzen…",
56
56
  "Results": "Ergebnisse",
@@ -51,7 +51,7 @@
51
51
  "Read Firmware": "Read Firmware",
52
52
  "Refresh": "Refresh",
53
53
  "Rename device": "Rename device",
54
- "Reset Info": "A soft reset will just restart routines and the CC253x. A hard reset will clear paired devices data and reset CC253x settings too. You will have to repair ALL of your devices!",
54
+ "Reset Info": "A soft reset will just restart routines and the Coordinator. A hard reset will clear paired devices data and reset the Coordinator settings too. You will have to repair ALL of your devices!",
55
55
  "Reset confirmation": "Reset confirmation",
56
56
  "Reset...": "Reset…",
57
57
  "Results": "Results",
@@ -51,7 +51,7 @@
51
51
  "Read Firmware": "Lire le micrologiciel",
52
52
  "Refresh": "Rafraîchir",
53
53
  "Rename device": "Renommer le dispositif",
54
- "Reset Info": "Un redémarrage en douceur redémarrera uniquement les routines et le CC253x. Une réinitialisation matérielle efface les données de dispositifs couplés et réinitialise aussi la configuration du CC253x. Vous devez re-coupler TOUS vos dispositifs !",
54
+ "Reset Info": "Un redémarrage en douceur redémarrera uniquement les routines et le Coordinator. Une réinitialisation matérielle efface les données de dispositifs couplés et réinitialise aussi la configuration du Coordinator. Vous devez re-coupler TOUS vos dispositifs !",
55
55
  "Reset confirmation": "Confirmation de réinitialisation",
56
56
  "Reset...": "Réinitialiser…",
57
57
  "Results": "Résultats",
@@ -51,7 +51,7 @@
51
51
  "Read Firmware": "Lees Firmware",
52
52
  "Refresh": "Vernieuwen",
53
53
  "Rename device": "Apparaat hernoemen",
54
- "Reset Info": "Een zachte reset herstart de routines en CC253x. Met een harde reset worden gegevens van gekoppelde apparaten gewist en ook de CC253x-instellingen gereset. U moet AL uw apparaten opnieuw aanleren!",
54
+ "Reset Info": "Een zachte reset herstart de routines en Coordinator. Met een harde reset worden gegevens van gekoppelde apparaten gewist en ook de Coordinator-instellingen gereset. U moet AL uw apparaten opnieuw aanleren!",
55
55
  "Reset confirmation": "Reset bevestiging",
56
56
  "Reset...": "Reset …",
57
57
  "Results": "Resultaten",
@@ -51,7 +51,7 @@
51
51
  "Read Firmware": "Przeczytaj oprogramowanie sprzętowe",
52
52
  "Refresh": "Refresh",
53
53
  "Rename device": "Zmień nazwę urządzenia",
54
- "Reset Info": "Soft reset zrestartuje tylko procedury i CC253x. Hard-Reset wyczyści dane połączonychurządzeń i zresetuje również ustawienia CC253x. Będziesz musiał naprawić WSZYSTKIE swoje urządzenia!",
54
+ "Reset Info": "Soft reset zrestartuje tylko procedury i Coordinator. Hard-Reset wyczyści dane połączonych urządzeń i zresetuje również ustawienia Coordynatora. Będziesz musiał połączyć WSZYSTKIE swoje urządzenia!",
55
55
  "Reset confirmation": "Reset potwierdzenie",
56
56
  "Reset...": "Resetowanie…",
57
57
  "Results": "Wyniki",
@@ -51,7 +51,7 @@
51
51
  "Read Firmware": "Ler Firmware",
52
52
  "Refresh": "Atualizar",
53
53
  "Rename device": "Renomear dispositivo",
54
- "Reset Info": "A Soft reset will just restart routines and CC253x. Hard-Reset will clear paired devices data and it resets CC253x settings too. You will have to repair ALL of your devices!",
54
+ "Reset Info": "A Soft reset will just restart routines and Coordinator. Hard-Reset will clear paired devices data and it resets Coordinator settings too. You will have to repair ALL of your devices!",
55
55
  "Reset confirmation": "Reset confirmação",
56
56
  "Reset...": "Redefinir...",
57
57
  "Results": "Resultados",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file