Skip to content

Commit

Permalink
more bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonywebb committed Nov 10, 2014
1 parent 1d1d766 commit dec7506
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 109 deletions.
5 changes: 0 additions & 5 deletions cgate.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@ function parseMessage(data,type) {
if(temp[0] == 'level') {
packet.type = 'info';
packet.level = humanLevelValue(temp[1]);
if(packet.level>0){
packet.status = 'on';
} else {
packet.status = 'off';
}
var ind = (array.length == 3 ? 1 : 0);
var temp2 = array[ind].match(/\d+/g);
packet.group = temp2[temp2.length-1];
Expand Down
5 changes: 1 addition & 4 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,11 @@ exports.deviceObjToArray = function(devices){
_.each(groups,function(group){
var obj = {group:group};
obj.level = parseInt(devices[group].level);
obj.status = devices[group].status;
obj.name = devices[group].name;
obj.location = devices[group].location;
obj.lastchange = devices[group].lastchange;
obj.changecount = devices[group].changecount;
obj.runtime = devices[group].runtime;
obj.type = devices[group].type;
obj.energyused = devices[group].energyused;
obj.vendor = devices[group].vendor;

// only pop it on the list if it is visible
if(devices[group].visible){
Expand Down
Loading

0 comments on commit dec7506

Please sign in to comment.