mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 23:00:55 +00:00
Update zigbee.js
Add "removedevice" Function into zigbee.js
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user