diff --git a/lib/zigbee.js b/lib/zigbee.js index 677a98080..544c3db08 100644 --- a/lib/zigbee.js +++ b/lib/zigbee.js @@ -108,6 +108,22 @@ class Zigbee { return this.shepherd.list().filter((device) => device.type !== 'Coordinator'); } + removedevice(deviceID) { + if (deviceID) { + logger.info(`Found Device with ID ${deviceID}`); + this.shepherd.remove('deviceID', function (err) { + if (err) { + console.log(`Failed to removed ${deviceID}`); + } else { + console.log(`Successfully removed ${deviceID}`); + } + }); + } else { + logger.error('removedevice function need deviceID to proceed'); + return; + } + } + ping(deviceID) { const device = this.shepherd._findDevByAddr(deviceID);