Skip to content

Commit f325835

Browse files
committed
amend docs
1 parent 55becda commit f325835

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

README-api.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
## API
22

3-
Start by loading the addon with `require`:
3+
Start by loading the addon with `require` and then create a new instance of the addon:
44
```js
55
var OZW = require('openzwave-shared');
6-
```
7-
and then create a new instance of the addon:
8-
```js
96
var zwave = new OZW();
107
```
8+
119
You can also pass in an optional object specifying any desired option overrides:
1210
```js
1311
var zwave = new OZW({
14-
Logging: false, // disable file logging (OZWLog.txt)
12+
Logging: false, // disable file logging (OZWLog.txt)
1513
ConsoleOutput: true // enable console logging
1614
});
1715
```
16+
17+
The underlying OpenZWave library is a effectively a singleton so you can simply do:
18+
```js
19+
var zwave = require("openzwave-shared")({
20+
ConsoleOutput: false
21+
});
22+
```
23+
1824
The default options are specified in `config/options.xml`. Please refer
1925
[to the full list of OpenZWave options](https://github.com/OpenZWave/open-zwave/wiki/Config-Options)
2026
for all the available options. If, for instance, you're using security devices

README-example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ zwave.on('node added', function(nodeid) {
4545
zwave.on('value added', function(nodeid, comclass, valueId) {
4646
if (!nodes[nodeid]['classes'][comclass])
4747
nodes[nodeid]['classes'][comclass] = {};
48-
nodes[nodeid]['classes'][comclass][valueId.index] = value;
48+
nodes[nodeid]['classes'][comclass][valueId.index] = valueId;
4949
});
5050

5151
zwave.on('value changed', function(nodeid, comclass, value) {

0 commit comments

Comments
 (0)