Completely refactored

This commit is contained in:
Foxi352 committed 2016-07-03 17:51:26 +02:00
1 parent e7eace942f
commit 40afa67a3a
4 files changed
+222 -145

No files matched your search

+3 -1
View File
@@ -57,8 +57,10 @@ SmartHomeNGConnection.prototype.receive = function(message) {
}
SmartHomeNGConnection.prototype.setValue = function(item, value) {
var command = '{"cmd":"item","id":"' + item + '","val":"' + value + '"}';
this.log("Sending " + command + " to SmartHomeNG");
if (this.connected) {
this.connection.send('{"cmd":"item","id":"' + item + '","val":"' + value + '"}')
this.connection.send(command)
} else {
this.log("Cannot switch " + item + ", no connection to SmartHomeNG !")
}