mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-10-22 14:01:20 +00:00
1 parent
eae8a80588
commit
a976c1db93
3 files changed
+17
-23
No files matched your search
+5
-17
@@ -124,27 +124,15 @@ class Zigbee {
|
||||
}
|
||||
}
|
||||
|
||||
configureReport(ieeeAddr, reports) {
|
||||
reports.forEach((r) => {
|
||||
const device = this.shepherd.find(ieeeAddr, r.ep);
|
||||
if (device) {
|
||||
device.report(r.cid, r.attr, r.minInt, r.maxInt, r.repChange, (error) => {
|
||||
if (error) {
|
||||
logger.warn(`Failed to configure reporting for ${ieeeAddr} ${r.cid} ${r.attr}`);
|
||||
} else {
|
||||
logger.info(`Configured reporting for ${ieeeAddr} ${r.cid} ${r.attr}`);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
logger.warn(`Failed to configure reporting for ${ieeeAddr} ${r.cid} ${r.attr} (device not found)`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getDevice(deviceID) {
|
||||
return this.shepherd.list().find((d) => d.ieeeAddr === deviceID);
|
||||
}
|
||||
|
||||
getCoordinator() {
|
||||
const device = this.shepherd.list().find((d) => d.type === 'Coordinator');
|
||||
return this.shepherd.find(device.ieeeAddr, 1);
|
||||
}
|
||||
|
||||
publish(deviceID, cid, cmd, zclData, ep, callback) {
|
||||
const device = this._findDevice(deviceID, ep);
|
||||
if (!device) {
|
||||
|
||||
Reference in new issue
Block a user