Skip to content

Commit

Permalink
Merge pull request #21 from daberlin/master
Browse files Browse the repository at this point in the history
Log switch status only in debug mode
  • Loading branch information
Supereg authored Nov 24, 2018
2 parents d201190 + e50e85d commit d678baa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ HTTP_SWITCH.prototype = {
this.log(`Body of status response is: '${body}'`);

const switchedOn = this.statusPattern.test(body);
this.log("Switch is currently %s", switchedOn? "ON": "OFF");
if (this.debug)
this.log("Switch is currently %s", switchedOn? "ON": "OFF");

callback(null, switchedOn);
}
});
Expand Down Expand Up @@ -435,4 +437,4 @@ HTTP_SWITCH.prototype = {
}
},

};
};

0 comments on commit d678baa

Please sign in to comment.