iobroker.zigbee 1.9.5 → 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,6 +134,10 @@ 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
+
137
141
  ### 1.9.5 (2023-12-29)
138
142
  * (arteck) update dependency
139
143
  * (arteck) min node 18.x.
@@ -540,7 +544,7 @@ new Zigbee-herdsman features:
540
544
  ## License
541
545
  The MIT License (MIT)
542
546
 
543
- Copyright (c) 2018-2023 Kirov Ilya <kirovilya@gmail.com>
547
+ Copyright (c) 2018-2024 Kirov Ilya <kirovilya@gmail.com>
544
548
 
545
549
  Permission is hereby granted, free of charge, to any person obtaining a copy
546
550
  of this software and associated documentation files (the "Software"), to deal
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee",
4
- "version": "1.9.5",
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
+ },
6
19
  "1.9.5": {
7
20
  "en": "update dependency\nmin node 18.x.",
8
21
  "de": "aktualisierung abhängigkeit\nmin node 18.x.",
@@ -80,19 +93,6 @@
80
93
  "pl": "do nowego żc\nzależności",
81
94
  "uk": "до нового жк\nоновлення залежності",
82
95
  "zh-cn": "新的忠诚\n更新"
83
- },
84
- "1.8.27": {
85
- "en": "update dependency",
86
- "de": "aktualisierung abhängigkeit",
87
- "ru": "обновление зависимости",
88
- "pt": "dependência de atualização",
89
- "nl": "vertaling:",
90
- "fr": "mettre à jour la dépendance",
91
- "it": "dipendenza da aggiornamento",
92
- "es": "actualización de la dependencia",
93
- "pl": "zależności",
94
- "uk": "оновлення залежності",
95
- "zh-cn": "更新"
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.5",
3
+ "version": "1.9.6",
4
4
  "author": {
5
5
  "name": "Kirov Ilya",
6
6
  "email": "kirovilya@gmail.com"
@@ -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",