Skip to content

Commit

Permalink
Coordinator group is not needed anymore. Koenkk#102
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Feb 18, 2019
1 parent 347a6bb commit 9a66b04
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 82 deletions.
2 changes: 0 additions & 2 deletions lib/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const ExtensionBridgeConfig = require('./extension/bridgeConfig');
const ExtensionGroups = require('./extension/groups');
const ExtensionDeviceAvailability = require('./extension/deviceAvailability');
const ExtensionDeviceBind = require('./extension/deviceBind');
const ExtensionCoordinatorGroup = require('./extension/coordinatorGroup');
const ExtensionDeviceReport = require('./extension/deviceReport');
const ExtensionLivolo = require('./extension/livolo');

Expand All @@ -45,7 +44,6 @@ class Controller {
new ExtensionBridgeConfig(this.zigbee, this.mqtt, this.state, this.publishEntityState),
new ExtensionGroups(this.zigbee, this.mqtt, this.state, this.publishEntityState),
new ExtensionDeviceBind(this.zigbee, this.mqtt, this.state, this.publishEntityState),
new ExtensionCoordinatorGroup(this.zigbee, this.mqtt, this.state, this.publishEntityState),
new ExtensionDeviceReport(this.zigbee, this.mqtt, this.state, this.publishEntityState),
];

Expand Down
56 changes: 0 additions & 56 deletions lib/extension/coordinatorGroup.js

This file was deleted.

24 changes: 0 additions & 24 deletions lib/zigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ class Zigbee {
this.shepherd.controller.request('UTIL', 'ledControl', {ledid: 3, mode: 0});
}

// Add the coordinator to group 99
this.addCoordinatorToGroup(99);

// Wait some time before we start the queue, many calls skip this queue which hangs the stick
setTimeout(() => {
this.queue.autostart = true;
Expand All @@ -130,27 +127,6 @@ class Zigbee {
logger.info('zigbee-shepherd ready');
}

addCoordinatorToGroup(groupID, callback=() => {}) {
this.shepherd.controller.request('ZDO', 'extFindGroup', {groupid: groupID, endpoint: 1}, (err) => {
// Error means that the coordinator is not in the group yet.
if (err) {
const payload = {groupid: groupID, endpoint: 1, namelen: 0, groupname: ''};
this.shepherd.controller.request('ZDO', 'extAddGroup', payload, (err) => {
if (err) {
logger.info(`Successfully added coordinator to group '${groupID}'`);
callback(false);
} else {
logger.error(`Failed to add coordinator to group '${groupID}'`);
callback(true);
}
});
} else {
logger.debug(`Coordinator is already in group '${groupID}'`);
callback(false);
}
});
}

onError(message) {
// This event may appear if zigbee-shepherd cannot decode bad packets (invalid checksum).
logger.error(message);
Expand Down

0 comments on commit 9a66b04

Please sign in to comment.