iobroker.zigbee 1.9.4 → 1.9.6

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018-2023 Kirov Ilya <kirovilya@gmail.com>
3
+ Copyright (c) 2018-2024 Kirov Ilya <kirovilya@gmail.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -134,8 +134,16 @@ You can thank the authors by these links:
134
134
  -----------------------------------------------------------------------------------------------------
135
135
 
136
136
  ## Changelog
137
+ ### 1.9.6 (2024-01-01)
138
+ * (arteck) corr ikea bug
139
+ * (crckmc) trv child lock works
140
+
141
+ ### 1.9.5 (2023-12-29)
142
+ * (arteck) update dependency
143
+ * (arteck) min node 18.x.
144
+
137
145
  ### 1.9.4 (2023-12-29)
138
- * (arteck) type
146
+ * (arteck) typo
139
147
 
140
148
  ### 1.9.3 (2023-12-26)
141
149
  * (arteck) last zhc Version 16.x
@@ -536,7 +544,7 @@ new Zigbee-herdsman features:
536
544
  ## License
537
545
  The MIT License (MIT)
538
546
 
539
- Copyright (c) 2018-2023 Kirov Ilya <kirovilya@gmail.com>
547
+ Copyright (c) 2018-2024 Kirov Ilya <kirovilya@gmail.com>
540
548
 
541
549
  Permission is hereby granted, free of charge, to any person obtaining a copy
542
550
  of this software and associated documentation files (the "Software"), to deal
package/io-package.json CHANGED
@@ -1,14 +1,40 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee",
4
- "version": "1.9.4",
4
+ "version": "1.9.6",
5
5
  "news": {
6
+ "1.9.6": {
7
+ "en": "corr ikea bug \ntrv child lock works",
8
+ "de": "corr ikea bug\nkinderschlösser funktioniert",
9
+ "ru": "корр ikea баг\ntrv детские замки работает",
10
+ "pt": "corr ikea bug\ntrabalhos de bloqueio de crianças",
11
+ "nl": "_\nhet kinderslot werkt",
12
+ "fr": "corr ikea bug\nverrouillage enfant trv fonctionne",
13
+ "it": "corr ikea bug\ntrv bambino serratura lavori",
14
+ "es": "corr ikea bug\ntrv niño cerradura funciona",
15
+ "pl": "kor ikea bug\npracuje w trv childlock",
16
+ "uk": "ikea помилка\ntrv дитячих замків",
17
+ "zh-cn": "绑架\n童 工"
18
+ },
19
+ "1.9.5": {
20
+ "en": "update dependency\nmin node 18.x.",
21
+ "de": "aktualisierung abhängigkeit\nmin node 18.x.",
22
+ "ru": "обновление зависимости\nмин. нода 18.x.",
23
+ "pt": "dependência de atualização\nmin node 18.x.",
24
+ "nl": "vertaling:\n_.",
25
+ "fr": "mettre à jour la dépendance\nmin node 18.x.",
26
+ "it": "dipendenza da aggiornamento\nmin nodo 18.x.",
27
+ "es": "actualización de la dependencia\nmin node 18.x.",
28
+ "pl": "zależności\nwęzeł 18.x.",
29
+ "uk": "оновлення залежності\nхв вузол 18.x.",
30
+ "zh-cn": "更新\n第18.x条."
31
+ },
6
32
  "1.9.4": {
7
- "en": "type",
8
- "de": "typ",
33
+ "en": "typo",
34
+ "de": "typo",
9
35
  "ru": "тип",
10
36
  "pt": "tipo",
11
- "nl": "type type type type type type type type type type type type type type type type type type type type type type type type type type type type type typety type type type type type type type type type type type type type type type typety type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type typety type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type type",
37
+ "nl": "type",
12
38
  "fr": "type",
13
39
  "it": "tipo",
14
40
  "es": "tipo",
@@ -67,32 +93,6 @@
67
93
  "pl": "do nowego żc\nzależności",
68
94
  "uk": "до нового жк\nоновлення залежності",
69
95
  "zh-cn": "新的忠诚\n更新"
70
- },
71
- "1.8.27": {
72
- "en": "update dependency",
73
- "de": "aktualisierung abhängigkeit",
74
- "ru": "обновление зависимости",
75
- "pt": "dependência de atualização",
76
- "nl": "vertaling:",
77
- "fr": "mettre à jour la dépendance",
78
- "it": "dipendenza da aggiornamento",
79
- "es": "actualización de la dependencia",
80
- "pl": "zależności",
81
- "uk": "оновлення залежності",
82
- "zh-cn": "更新"
83
- },
84
- "1.8.26": {
85
- "en": "corr toZigbee message\nadd deviceManager",
86
- "de": "corr toZigbee Nachricht\nadd-Gerät Manager",
87
- "ru": "corr toZigbee сообщение\nдобавить устройство менеджер",
88
- "pt": "mensagem de corrija\nadicionar dispositivo Gerente",
89
- "nl": "vertaling:\nvoeg Manager",
90
- "fr": "corr toZigbee message\najouter le dispositif Manager",
91
- "it": "corr aZigbee messaggio\naggiungere dispositivo Manager",
92
- "es": "corr toZigbee message\nañadir dispositivo Manager",
93
- "pl": "kor toZigbee message\ndodać manager",
94
- "uk": "corr toZigbee повідомлення\nдодати пристрій Менеджер",
95
- "zh-cn": "信\n增加装置 管理人员"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -624,61 +624,68 @@ class StatesController extends EventEmitter {
624
624
  }
625
625
  // find states for payload
626
626
  if (devStates.states !== undefined) {
627
- const states = statesMapping.commonStates.concat(
628
- devStates.states.filter(statedesc => payload.hasOwnProperty(statedesc.prop || statedesc.id)));
629
-
630
- for (const stateInd in states) {
631
- const statedesc = states[stateInd];
632
- let value;
633
- if (statedesc.getter) {
634
- value = statedesc.getter(payload);
635
- } else {
636
- value = payload[statedesc.prop || statedesc.id];
637
- }
638
- // checking value
639
- if (value === undefined || value === null) {
640
- continue;
641
- }
642
- let stateID = statedesc.id;
627
+ try {
628
+ const states = statesMapping.commonStates.concat(
629
+ devStates.states.filter(statedesc => payload.hasOwnProperty(statedesc.prop || statedesc.id))
630
+ );
631
+
632
+ for (const stateInd in states) {
633
+ const statedesc = states[stateInd];
634
+ let value;
635
+ if (statedesc.getter) {
636
+ value = statedesc.getter(payload);
637
+ } else {
638
+ value = payload[statedesc.prop || statedesc.id];
639
+ }
640
+ // checking value
641
+ if (value === undefined || value === null) {
642
+ continue;
643
+ }
643
644
 
644
- if (has_debug && statedesc.id !== 'msg_from_zigbee') {
645
- this.warn(`ELEVATED publishToState: value generated '${JSON.stringify(value)}' from device ${devId} for '${statedesc.name}'`);
646
- }
645
+ let stateID = statedesc.id;
647
646
 
648
- const common = {
649
- name: statedesc.name,
650
- type: statedesc.type,
651
- unit: statedesc.unit,
652
- read: statedesc.read,
653
- write: statedesc.write,
654
- icon: statedesc.icon,
655
- role: statedesc.role,
656
- min: statedesc.min,
657
- max: statedesc.max,
658
- };
659
-
660
- if (typeof value === 'object' && value.hasOwnProperty('stateid')) {
661
- stateID = `${stateID}.${value.stateid}`;
662
- if (value.hasOwnProperty('unit')) {
663
- common.unit = value.unit;
647
+ if (has_debug && statedesc.id !== 'msg_from_zigbee') {
648
+ this.warn(`ELEVATED publishToState: value generated '${JSON.stringify(value)}' from device ${devId} for '${statedesc.name}'`);
664
649
  }
665
- common.name = value.name ? value.name : value.stateid;
666
- common.role = value.role ? `value.${value.role}` : 'number';
667
- value = value.value;
668
- }
669
650
 
670
- // if needs to return value to back after timeout
671
- if (statedesc.isEvent) {
672
- this.updateStateWithTimeout(devId, statedesc.id, value, common, 300, !value);
673
- } else {
674
- if (statedesc.prepublish) {
675
- this.collectOptions(devId, model, options =>
676
- statedesc.prepublish(devId, value, newvalue =>
677
- this.updateState(devId, stateID, newvalue, common), options));
651
+ const common = {
652
+ name: statedesc.name,
653
+ type: statedesc.type,
654
+ unit: statedesc.unit,
655
+ read: statedesc.read,
656
+ write: statedesc.write,
657
+ icon: statedesc.icon,
658
+ role: statedesc.role,
659
+ min: statedesc.min,
660
+ max: statedesc.max,
661
+ };
662
+
663
+ if (typeof value === 'object' && value.hasOwnProperty('stateid')) {
664
+ stateID = `${stateID}.${value.stateid}`;
665
+ if (value.hasOwnProperty('unit')) {
666
+ common.unit = value.unit;
667
+ }
668
+ common.name = value.name ? value.name : value.stateid;
669
+ common.role = value.role ? `value.${value.role}` : 'number';
670
+ value = value.value;
671
+ }
672
+
673
+ // if needs to return value to back after timeout
674
+ if (statedesc.isEvent) {
675
+ this.updateStateWithTimeout(devId, statedesc.id, value, common, 300, !value);
678
676
  } else {
679
- this.updateState(devId, stateID, value, common);
677
+ if (statedesc.prepublish) {
678
+ this.collectOptions(devId, model, options =>
679
+ statedesc.prepublish(devId, value, newvalue =>
680
+ this.updateState(devId, stateID, newvalue, common), options)
681
+ );
682
+ } else {
683
+ this.updateState(devId, stateID, value, common);
684
+ }
680
685
  }
681
686
  }
687
+ } catch (e) {
688
+ this.debug(`No states in device ${devId} : payload ${JSON.stringify(payload)}`);
682
689
  }
683
690
  }
684
691
  }
@@ -40,7 +40,7 @@ class DeviceEvent extends BaseExtension {
40
40
  }
41
41
 
42
42
  if (mappedDevice && mappedDevice.onEvent) {
43
- mappedDevice.onEvent(type, data, device);
43
+ mappedDevice.onEvent(type, data, device,mappedDevice.options,'{}');
44
44
  }
45
45
  }
46
46
  }
package/main.js CHANGED
@@ -732,7 +732,7 @@ class Zigbee extends utils.Adapter {
732
732
  };
733
733
 
734
734
  // new toZigbee
735
- if (preparedValue !== undefined) {
735
+ if (preparedValue !== undefined && Object.keys(meta.message).filter(p => p.startsWith('state')).length > 0) {
736
736
  if (typeof preparedValue === 'number') {
737
737
  meta.message.state = preparedValue > 0 ? 'ON' : 'OFF';
738
738
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zigbee",
3
- "version": "1.9.4",
3
+ "version": "1.9.6",
4
4
  "author": {
5
5
  "name": "Kirov Ilya",
6
6
  "email": "kirovilya@gmail.com"
@@ -15,7 +15,7 @@
15
15
  }
16
16
  ],
17
17
  "engines": {
18
- "node": ">=16"
18
+ "node": ">=18"
19
19
  },
20
20
  "optionalDependencies": {
21
21
  "serialport": "^12.0.0"
@@ -36,11 +36,11 @@
36
36
  "@alcalzone/release-script-plugin-license": "^3.7.0",
37
37
  "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
38
38
  "@iobroker/testing": "^4.1.0",
39
- "axios": "^1.6.0",
39
+ "axios": "^1.6.3",
40
40
  "chai": "^4.3.10",
41
41
  "chai-as-promised": "^7.1.1",
42
42
  "eslint": "^8.52.0",
43
- "eslint-config-prettier": "^9.0.0",
43
+ "eslint-config-prettier": "^9.1.0",
44
44
  "eslint-plugin-prettier": "^5.0.0",
45
45
  "gulp": "^4.0.2",
46
46
  "gulp-jsdoc3": "^3.0.0",