-
Notifications
You must be signed in to change notification settings - Fork 6
/
test.js
68 lines (43 loc) · 1.43 KB
/
test.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const Rega = require('./index.js');
const rega = new Rega({
host: 'homematic-ccu3',
disableTranslation: false
});
/*
rega.exec('string x = "Hello";\nWriteLine(x # " World!");', (err, output, objects) => {
if (err) {
throw err;
}
console.log('Script Output:', output);
console.log('Script Objects:', objects);
rega.getVariables((err, res) => {
console.log('getVariables', err, res);
rega.getRooms((err, res) => {
console.log('getRooms', err, res);
rega.getFunctions((err, res) => {
console.log('getFunctions', err, res);
rega.getPrograms((err, res) => {
console.log('getPrograms', err, res);
rega.getChannels((err, res) => {
console.log('getChannels', err, res);
});
});
});
});
});
});
rega.getChannels((err, res) => {
console.log(err);
require('fs').writeFileSync('channels.json', JSON.stringify(res, null, ' '));
rega.getValues((err, res) => {
console.log(err);
require('fs').writeFileSync('values.json', JSON.stringify(res, null, ' '));
});
});
rega.getRooms((err, res) => {
console.log(err,res);
// require('fs').writeFileSync('values.json', JSON.stringify(res, null, ' '));
});*/
rega.getVariables((err, res) => {
console.log('getVariables', err, res);
});