We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8545309 commit 24fbe25Copy full SHA for 24fbe25
lib/zigbee.ts
@@ -330,10 +330,15 @@ export default class Zigbee {
330
}
331
332
devices(includeCoordinator = true): Device[] {
333
- return this.herdsman
334
- .getDevices()
335
- .map((d) => this.resolveDevice(d.ieeeAddr))
336
- .filter((d) => includeCoordinator || d.zh.type !== 'Coordinator');
+ const devices: Device[] = [];
+
+ for (const device of this.herdsman.getDevices()) {
+ if (includeCoordinator || device.type !== 'Coordinator') {
337
+ devices.push(this.resolveDevice(device.ieeeAddr));
338
+ }
339
340
341
+ return devices;
342
343
344
@bind private async acceptJoiningDeviceHandler(ieeeAddr: string): Promise<boolean> {
0 commit comments