log adjustments

This commit is contained in:
Jesse Newland
2015-05-19 21:40:53 -07:00
parent 4feffe9bc6
commit 46d99a4615

View File

@@ -50,11 +50,9 @@ function SmartThingsAccessory(log, name, commands) {
SmartThingsAccessory.prototype = { SmartThingsAccessory.prototype = {
command: function(c,value) { command: function(c,value) {
this.log("Received command " + c); this.log(this.name + " sending command " + c);
var url; var url = this.commands[c];
if (value == undefined) { if (value != undefined) {
url = this.commands[c];
} else {
url = this.commands[c] + "&value="+value url = this.commands[c] + "&value="+value
} }
@@ -63,10 +61,10 @@ SmartThingsAccessory.prototype = {
url: url url: url
}, function(err, response) { }, function(err, response) {
if (err) { if (err) {
that.log("There was a problem sending command " + c + " to SmartThings"); that.log("There was a problem sending command " + c + " to" + that.name);
that.log(url); that.log(url);
} else { } else {
that.log("Sent command " + c); that.log(that.name + " sent command " + c);
} }
}) })
}, },