iobroker.zigbee2mqtt 2.13.4 → 2.13.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.
@@ -35,6 +35,8 @@ class StatesController {
35
35
  this.adapter.log.warn(`--->>> fromZ2M -> ${device.ieee_address} states: ${JSON.stringify(messageObj)}`);
36
36
  }
37
37
 
38
+ const actionStates = [];
39
+
38
40
  for (const [key, value] of Object.entries(messageObj.payload)) {
39
41
 
40
42
  if (value === undefined || value === null) {
@@ -64,17 +66,7 @@ class StatesController {
64
66
  try {
65
67
  // Is an action
66
68
  if (state.prop && state.prop == 'action') {
67
- if (state.isEvent && state.isEvent == true) {
68
- if (state.type == 'boolean') {
69
- await this.setStateWithTimeoutAsync(stateName, state.getter(messageObj.payload), 450);
70
- }
71
- else {
72
- await this.setStateSafelyAsync(stateName, state.getter(messageObj.payload));
73
- }
74
- }
75
- else {
76
- await this.setStateChangedSafelyAsync(stateName, state.getter(messageObj.payload));
77
- }
69
+ actionStates.push(state);
78
70
  }
79
71
  // Is not an action
80
72
  else {
@@ -90,6 +82,28 @@ class StatesController {
90
82
  }
91
83
  }
92
84
  }
85
+
86
+ for (const state of actionStates) {
87
+
88
+ const stateName = `${device.ieee_address}.${state.id}`;
89
+
90
+ try {
91
+ if (state.isEvent && state.isEvent == true) {
92
+ if (state.type == 'boolean') {
93
+ await this.setStateWithTimeoutAsync(stateName, state.getter(messageObj.payload), 450);
94
+ }
95
+ else {
96
+ await this.setStateSafelyAsync(stateName, state.getter(messageObj.payload));
97
+ }
98
+ }
99
+ else {
100
+ await this.setStateChangedSafelyAsync(stateName, state.getter(messageObj.payload));
101
+ }
102
+ } catch (err) {
103
+ incStatsQueue[incStatsQueue.length] = messageObj;
104
+ this.adapter.log.debug(`Can not set ${stateName}, queue state in incStatsQueue!`);
105
+ }
106
+ }
93
107
  }
94
108
 
95
109
  async setStateSafelyAsync(stateName, value) {
package/main.js CHANGED
@@ -265,7 +265,7 @@ class Zigbee2mqtt extends core.Adapter {
265
265
  if (mqttClient && !mqttClient.closed) {
266
266
  try {
267
267
  if (mqttClient) {
268
- mqttClient.close();
268
+ mqttClient.end();
269
269
  }
270
270
  } catch (e) {
271
271
  this.log.error(e);
@@ -354,4 +354,4 @@ if (require.main !== module) {
354
354
  } else {
355
355
  // otherwise start the instance directly
356
356
  new Zigbee2mqtt();
357
- }
357
+ }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "iobroker.zigbee2mqtt",
3
- "version": "2.13.4",
3
+ "version": "2.13.6",
4
4
  "description": "Zigbee2MQTT adapter for ioBroker",
5
5
  "author": {
6
- "name": "Dennis Rathjen",
7
- "email": "dennis.rathjen@outlook.de"
6
+ "name": "Dennis Rathjen and Arthur Rupp",
7
+ "email": "arteck@outlook.com"
8
8
  },
9
- "homepage": "https://github.com/o0shojo0o/ioBroker.zigbee2mqtt",
9
+ "homepage": "https://github.com/arteck/ioBroker.zigbee2mqtt",
10
10
  "license": "MIT",
11
11
  "keywords": [
12
12
  "ioBroker",
@@ -16,24 +16,25 @@
16
16
  ],
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "https://github.com/o0shojo0o/ioBroker.zigbee2mqtt.git"
19
+ "url": "https://github.com/arteck/ioBroker.zigbee2mqtt.git"
20
20
  },
21
21
  "engines": {
22
22
  "node": ">= 16"
23
23
  },
24
24
  "dependencies": {
25
25
  "@iobroker/adapter-core": "^3.0.4",
26
- "aedes": "^0.50.0",
26
+ "@iobroker/dm-utils": "^0.1.9",
27
+ "aedes": "^0.51.0",
27
28
  "aedes-persistence-nedb": "^2.0.3",
28
- "mqtt": "~5.1.4",
29
+ "mqtt": "~5.3.5",
29
30
  "net": "^1.0.2",
30
31
  "node-schedule": "^2.1.1",
31
- "sharp": "^0.32.6",
32
- "ws": "^8.13.0"
32
+ "sharp": "^0.33.1",
33
+ "ws": "^8.16.0"
33
34
  },
34
35
  "devDependencies": {
35
36
  "@alcalzone/release-script": "^3.7.0",
36
- "@alcalzone/release-script-plugin-iobroker": "^3.6.0",
37
+ "@alcalzone/release-script-plugin-iobroker": "^3.7.0",
37
38
  "@alcalzone/release-script-plugin-license": "^3.7.0",
38
39
  "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
39
40
  "@iobroker/adapter-dev": "^1.2.0",
@@ -41,23 +42,23 @@
41
42
  "@tsconfig/node14": "^14.1.0",
42
43
  "@types/chai": "^4.3.5",
43
44
  "@types/chai-as-promised": "^7.1.8",
44
- "@types/mocha": "^10.0.2",
45
- "@types/node": "^20.8.10",
46
- "@types/node-schedule": "^2.1.0",
45
+ "@types/mocha": "^10.0.6",
46
+ "@types/node": "^20.11.24",
47
+ "@types/node-schedule": "^2.1.5",
47
48
  "@types/proxyquire": "^1.3.31",
48
- "@types/sinon": "^10.0.16",
49
- "@types/sinon-chai": "^3.2.9",
50
- "chai": "^4.3.8",
49
+ "@types/sinon": "^17.0.3",
50
+ "@types/sinon-chai": "^3.2.12",
51
+ "chai": "^4.4.0",
51
52
  "chai-as-promised": "^7.1.1",
52
- "eslint": "^8.50.0",
53
- "eslint-config-prettier": "^9.0.0",
54
- "eslint-plugin-prettier": "^5.0.1",
53
+ "eslint": "^8.57.0",
54
+ "eslint-config-prettier": "^9.1.0",
55
+ "eslint-plugin-prettier": "^5.1.2",
55
56
  "mocha": "^10.2.0",
56
- "prettier": "^3.0.3",
57
+ "prettier": "^3.2.5",
57
58
  "proxyquire": "^2.1.3",
58
- "sinon": "^16.0.0",
59
+ "sinon": "^17.0.1",
59
60
  "sinon-chai": "^3.7.0",
60
- "typescript": "~5.2.2"
61
+ "typescript": "~5.3.3"
61
62
  },
62
63
  "main": "main.js",
63
64
  "files": [
@@ -80,7 +81,7 @@
80
81
  "release": "release-script"
81
82
  },
82
83
  "bugs": {
83
- "url": "https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues"
84
+ "url": "https://github.com/arteck/ioBroker.zigbee2mqtt/issues"
84
85
  },
85
86
  "readmeFilename": "README.md"
86
87
  }