Skip to content

Commit d678baa

Browse files
Merge pull request #21 from daberlin/master
Log switch status only in debug mode
2 parents d201190 + e50e85d commit d678baa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ HTTP_SWITCH.prototype = {
292292
this.log(`Body of status response is: '${body}'`);
293293

294294
const switchedOn = this.statusPattern.test(body);
295-
this.log("Switch is currently %s", switchedOn? "ON": "OFF");
295+
if (this.debug)
296+
this.log("Switch is currently %s", switchedOn? "ON": "OFF");
297+
296298
callback(null, switchedOn);
297299
}
298300
});
@@ -435,4 +437,4 @@ HTTP_SWITCH.prototype = {
435437
}
436438
},
437439

438-
};
440+
};

0 commit comments

Comments
 (0)