Skip to content

Commit

Permalink
GroupDevices module fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Poltorak Serguei committed Sep 12, 2015
1 parent f9d3427 commit 88d74c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/GroupDevices/index.js
Expand Up @@ -90,18 +90,20 @@ GroupDevices.prototype.init = function (config) {
};

this.config.devices.forEach(function(dev) {
this.controller.devices.on(dev.device, "change:metrics:level", this.handler);
this.controller.devices.on(dev.device, "change:metrics:level", self.handler);
});
};

GroupDevices.prototype.stop = function () {
var self = this;

if (this.vDev) {
this.controller.devices.remove(this.vDev.id);
this.vDev = null;
}

this.config.devices.forEach(function(dev) {
this.controller.devices.off(dev.device, "change:metrics:level", this.handler);
this.controller.devices.off(dev.device, "change:metrics:level", self.handler);
});

GroupDevices.super_.prototype.stop.call(this);
Expand Down

0 comments on commit 88d74c9

Please sign in to comment.