mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-16 18:39:09 -07:00
Update zigbee.js
Add "removedevice" Function into zigbee.js
This commit is contained in:
parent
ca27f9faf2
commit
0328ad7cb6
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user