Update zigbee-shepherd-converters to 1.0.1. #36 #62

This commit is contained in:
Koenkk committed 2018-06-04 21:36:51 +02:00
1 parent eae8a80588
commit a976c1db93
3 files changed
+17 -23

No files matched your search

+5 -17
View File
@@ -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) {