iobroker.zigbee2mqtt 2.13.4 → 2.13.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.
- package/LICENSE +1 -1
- package/README.md +35 -32
- package/admin/i18n/de/translations.json +1 -1
- package/admin/i18n/en/translations.json +2 -2
- package/admin/i18n/es/translations.json +1 -1
- package/admin/i18n/fr/translations.json +1 -1
- package/admin/i18n/it/translations.json +1 -1
- package/admin/i18n/nl/translations.json +1 -1
- package/admin/i18n/pl/translations.json +1 -1
- package/admin/i18n/pt/translations.json +1 -1
- package/admin/i18n/ru/translations.json +1 -1
- package/admin/i18n/uk/translations.json +1 -1
- package/admin/i18n/zh-cn/translations.json +1 -1
- package/admin/jsonConfig.json +2 -2
- package/io-package.json +48 -44
- package/lib/exposes.js +824 -794
- package/lib/statesController.js +25 -11
- package/main.js +2 -2
- package/package.json +22 -21
package/lib/statesController.js
CHANGED
|
@@ -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
|
+
let 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
|
-
|
|
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.
|
|
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.
|
|
3
|
+
"version": "2.13.5",
|
|
4
4
|
"description": "Zigbee2MQTT adapter for ioBroker",
|
|
5
5
|
"author": {
|
|
6
|
-
"name": "Dennis Rathjen",
|
|
7
|
-
"email": "
|
|
6
|
+
"name": "Dennis Rathjen and Arthur Rupp",
|
|
7
|
+
"email": "arteck@outlook.com"
|
|
8
8
|
},
|
|
9
|
-
"homepage": "https://github.com/
|
|
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/
|
|
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
|
-
"
|
|
26
|
+
"@iobroker/dm-utils": "^0.1.9",
|
|
27
|
+
"aedes": "^0.50.1",
|
|
27
28
|
"aedes-persistence-nedb": "^2.0.3",
|
|
28
|
-
"mqtt": "~5.
|
|
29
|
+
"mqtt": "~5.3.4",
|
|
29
30
|
"net": "^1.0.2",
|
|
30
31
|
"node-schedule": "^2.1.1",
|
|
31
|
-
"sharp": "^0.
|
|
32
|
-
"ws": "^8.
|
|
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.
|
|
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.
|
|
45
|
+
"@types/mocha": "^10.0.6",
|
|
45
46
|
"@types/node": "^20.8.10",
|
|
46
47
|
"@types/node-schedule": "^2.1.0",
|
|
47
48
|
"@types/proxyquire": "^1.3.31",
|
|
48
|
-
"@types/sinon": "^
|
|
49
|
-
"@types/sinon-chai": "^3.2.
|
|
50
|
-
"chai": "^4.
|
|
49
|
+
"@types/sinon": "^17.0.2",
|
|
50
|
+
"@types/sinon-chai": "^3.2.12",
|
|
51
|
+
"chai": "^4.4.0",
|
|
51
52
|
"chai-as-promised": "^7.1.1",
|
|
52
|
-
"eslint": "^8.
|
|
53
|
-
"eslint-config-prettier": "^9.
|
|
54
|
-
"eslint-plugin-prettier": "^5.
|
|
53
|
+
"eslint": "^8.56.0",
|
|
54
|
+
"eslint-config-prettier": "^9.1.0",
|
|
55
|
+
"eslint-plugin-prettier": "^5.1.2",
|
|
55
56
|
"mocha": "^10.2.0",
|
|
56
|
-
"prettier": "^3.
|
|
57
|
+
"prettier": "^3.1.1",
|
|
57
58
|
"proxyquire": "^2.1.3",
|
|
58
|
-
"sinon": "^
|
|
59
|
+
"sinon": "^17.0.1",
|
|
59
60
|
"sinon-chai": "^3.7.0",
|
|
60
|
-
"typescript": "~5.
|
|
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/
|
|
84
|
+
"url": "https://github.com/arteck/ioBroker.zigbee2mqtt/issues"
|
|
84
85
|
},
|
|
85
86
|
"readmeFilename": "README.md"
|
|
86
87
|
}
|