-
Notifications
You must be signed in to change notification settings - Fork 16
/
example.js
31 lines (28 loc) · 741 Bytes
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const luxtronik = require('./luxtronik');
const pump = luxtronik.createConnection('127.0.0.1', 8888);
pump.read(function (err, data) {
if (err) {
return console.log(err);
}
console.log(data);
console.log(data.values.errors);
require('fs').writeFileSync('data.json', JSON.stringify(data, null, 4));
});
/*
pump.write('heating_target_temperature', 0, function (err, data) {
if (!err) {
console.log(data);
}
});
pump.write('warmwater_target_temperature', 60);
pump.write('heating_operation_mode', 0, function (err, data) {
if (!err) {
console.log(data);
}
});
pump.write('warmwater_operation_mode', 0, function (err, data) {
if (!err) {
console.log(data);
}
});
*/