Skip to content

Commit

Permalink
fix issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
pathec committed Apr 30, 2017
1 parent be1d1fd commit 948d699
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/**
* @class OpenHABConnector
* @version 0.1.3
* @version 0.1.5
* @author Patrick Hecker <[email protected]>
*
*/
Expand Down Expand Up @@ -352,6 +352,16 @@ OpenHABConnector.prototype.notifyOpenHabItem = function (openHabItem) {
}
}

// doorlock device type has the state (level) open or close, but in
// openHAB doorlock is represented by a switch with on/off.
if(deviceType == "doorlock") {
if(vDev.get("metrics:level") == "open") {
level = "ON";
} else {
level = "OFF";
}
}

// load server by openHAB alias
var server = _.findWhere(self.openHabServers, {openHabAlias: openHabItem.openHabAlias});

Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"source" : "https://github.com/pathec/ZWay-OpenHABConnector",
"type" : "git"
},
"version": "0.1.4",
"version": "0.1.5",
"maturity": "beta",
"defaults" : {
"title" : "__m_title__",
Expand Down

0 comments on commit 948d699

Please sign in to comment.