iobroker.zigbee 3.0.5 → 3.1.4
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/README.md +34 -0
- package/admin/admin.js +475 -230
- package/admin/i18n/de/translations.json +16 -16
- package/admin/index_m.html +84 -91
- package/admin/tab_m.html +38 -16
- package/docs/de/readme.md +1 -1
- package/docs/en/readme.md +4 -2
- package/io-package.json +35 -28
- package/lib/DeviceDebug.js +25 -2
- package/lib/binding.js +8 -8
- package/lib/commands.js +386 -326
- package/lib/developer.js +2 -2
- package/lib/devices.js +13 -9
- package/lib/exclude.js +1 -1
- package/lib/exposes.js +56 -24
- package/lib/groups.js +408 -73
- package/lib/localConfig.js +23 -12
- package/lib/networkmap.js +10 -2
- package/lib/states.js +32 -2
- package/lib/statescontroller.js +361 -209
- package/lib/utils.js +7 -5
- package/lib/zbDelayedAction.js +4 -4
- package/lib/zbDeviceAvailability.js +102 -46
- package/lib/zbDeviceConfigure.js +7 -0
- package/lib/zbDeviceEvent.js +40 -7
- package/lib/zigbeecontroller.js +552 -75
- package/main.js +168 -505
- package/package.json +8 -11
- package/lib/tools.js +0 -55
package/lib/DeviceDebug.js
CHANGED
|
@@ -39,7 +39,7 @@ class DeviceDebug extends EventEmitter {
|
|
|
39
39
|
let flag='NONE';
|
|
40
40
|
if (message.hasOwnProperty('data')) {
|
|
41
41
|
const dataId = message.ID;
|
|
42
|
-
const item = this.dataByID[dataId] ? this.dataByID[dataId] : { dataID: dataId, deviceID:'unknown', states:[],flags:[], errors:[], IO:message.IO };
|
|
42
|
+
const item = this.dataByID[dataId] ? this.dataByID[dataId] : { dataID: dataId, deviceID:'unknown', states:[],flags:[], errors:[], IO:message.IO, messages:{} };
|
|
43
43
|
this.dataByID[dataId] = item;
|
|
44
44
|
const data = message.data;
|
|
45
45
|
if (data.error && item.errors.indexOf(data.error)<0) item.errors.push(data.error);
|
|
@@ -53,6 +53,11 @@ class DeviceDebug extends EventEmitter {
|
|
|
53
53
|
else flag = item.IO ? 'I'+data.flag : 'O'+data.flag;
|
|
54
54
|
else
|
|
55
55
|
flag = item.IO ? 'IN' : 'OUT';
|
|
56
|
+
if (message.message) {
|
|
57
|
+
let msgIdx = 0;
|
|
58
|
+
while (item.messages.hasOwnProperty(`${flag}${msgIdx ? '-'+msgIdx : ''}`)) msgIdx++;
|
|
59
|
+
item.messages[`${flag}${msgIdx ? '-'+msgIdx : ''}`] = message.message;
|
|
60
|
+
}
|
|
56
61
|
if (data.ID && data.ID !== item.deviceID) {
|
|
57
62
|
item.deviceID = data.ID;
|
|
58
63
|
const DevData = this.dataByDevice[item.deviceID] ? this.dataByDevice[item.deviceID] : { IN:[], OUT:[] };
|
|
@@ -73,9 +78,27 @@ class DeviceDebug extends EventEmitter {
|
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
deleteMessagesFor(item) {
|
|
82
|
+
if (item == 'all') {
|
|
83
|
+
this.dataByDevice = {};
|
|
84
|
+
this.dataByID = {};
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
delete this.dataByDevice[item];
|
|
88
|
+
const obsoleteIDs = [];
|
|
89
|
+
for (const id in this.dataByID) {
|
|
90
|
+
if (this.dataByID[id].deviceID === item) obsoleteIDs.push(id)
|
|
91
|
+
}
|
|
92
|
+
for (const id of obsoleteIDs) delete this.dataByID[id];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
collectDebugData(logStatus, del) {
|
|
96
|
+
this.warn('collectingData')
|
|
77
97
|
if (logStatus != undefined)
|
|
78
98
|
this.logStatus = logStatus;
|
|
99
|
+
if (del) {
|
|
100
|
+
this.deleteMessagesFor(del);
|
|
101
|
+
}
|
|
79
102
|
return this.dataByDevice;
|
|
80
103
|
}
|
|
81
104
|
}
|
package/lib/binding.js
CHANGED
|
@@ -153,7 +153,7 @@ class Binding {
|
|
|
153
153
|
if (source.endpoint.supportsOutputCluster(cluster) && targetValid) {
|
|
154
154
|
this.debug(`${type}ing cluster '${cluster}' from '${sourceName}' to '${targetName}'`);
|
|
155
155
|
try {
|
|
156
|
-
const bindTarget = target.type === 'group' ? target.
|
|
156
|
+
const bindTarget = target.type === 'group' ? target.device : target.endpoint;
|
|
157
157
|
if (type === 'bind') {
|
|
158
158
|
await source.endpoint.bind(cluster, bindTarget);
|
|
159
159
|
} else {
|
|
@@ -260,18 +260,18 @@ class Binding {
|
|
|
260
260
|
bind_target_ep = params.bind_target_ep;
|
|
261
261
|
await this.doBindUnbind('unbind', bind_source, bind_source_ep, bind_target, bind_target_ep, async err => {
|
|
262
262
|
if (err) {
|
|
263
|
-
callback({error: err});
|
|
263
|
+
if (callback) callback({error: err});
|
|
264
264
|
} else {
|
|
265
|
-
this.adapter.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
265
|
+
this.adapter.delObject(`info.${bind_id}`,{}, async (err) => {
|
|
266
|
+
if (err) {
|
|
267
|
+
if (callback) callback({error: err});
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
269
270
|
if (params.unbind_from_coordinator) {
|
|
270
271
|
await this.doBindUnbind('bind', bind_source, bind_source_ep, 'coordinator', '1', callback);
|
|
271
272
|
} else {
|
|
272
|
-
callback();
|
|
273
|
+
if (callback) callback();
|
|
273
274
|
}
|
|
274
|
-
//}
|
|
275
275
|
});
|
|
276
276
|
}
|
|
277
277
|
});
|