Skip to content

Commit ce5d8b5

Browse files
committed
update ident
1 parent 50d09cf commit ce5d8b5

File tree

4 files changed

+85
-71
lines changed

4 files changed

+85
-71
lines changed

admin/words.js

+37-37
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@
22
"use strict";
33

44
systemDictionary = {
5-
"vaillant adapter settings": {
6-
"en": "Adapter settings for vaillant",
7-
"de": "Adaptereinstellungen für vaillant",
8-
"ru": "Настройки адаптера для vaillant",
9-
"pt": "Configurações do adaptador para vaillant",
10-
"nl": "Adapterinstellingen voor vaillant",
11-
"fr": "Paramètres d'adaptateur pour vaillant",
12-
"it": "Impostazioni dell'adattatore per vaillant",
13-
"es": "Ajustes del adaptador para vaillant",
14-
"pl": "Ustawienia adaptera dla vaillant",
15-
"zh-cn": "vaillant的适配器设置"
16-
},
17-
"option1": {
18-
"en": "option1",
19-
"de": "Option 1",
20-
"ru": "Опция 1",
21-
"pt": "Opção 1",
22-
"nl": "Optie 1",
23-
"fr": "Option 1",
24-
"it": "opzione 1",
25-
"es": "Opción 1",
26-
"pl": "opcja 1",
27-
"zh-cn": "选项1"
28-
},
29-
"option2": {
30-
"en": "option2",
31-
"de": "Option 2",
32-
"ru": "option2",
33-
"pt": "opção 2",
34-
"nl": "Optie 2",
35-
"fr": "Option 2",
36-
"it": "opzione 2",
37-
"es": "opcion 2",
38-
"pl": "Opcja 2",
39-
"zh-cn": "选项2"
40-
}
41-
};
5+
"vaillant adapter settings": {
6+
en: "Adapter settings for vaillant",
7+
de: "Adaptereinstellungen für vaillant",
8+
ru: "Настройки адаптера для vaillant",
9+
pt: "Configurações do adaptador para vaillant",
10+
nl: "Adapterinstellingen voor vaillant",
11+
fr: "Paramètres d'adaptateur pour vaillant",
12+
it: "Impostazioni dell'adattatore per vaillant",
13+
es: "Ajustes del adaptador para vaillant",
14+
pl: "Ustawienia adaptera dla vaillant",
15+
"zh-cn": "vaillant的适配器设置",
16+
},
17+
option1: {
18+
en: "option1",
19+
de: "Option 1",
20+
ru: "Опция 1",
21+
pt: "Opção 1",
22+
nl: "Optie 1",
23+
fr: "Option 1",
24+
it: "opzione 1",
25+
es: "Opción 1",
26+
pl: "opcja 1",
27+
"zh-cn": "选项1",
28+
},
29+
option2: {
30+
en: "option2",
31+
de: "Option 2",
32+
ru: "option2",
33+
pt: "opção 2",
34+
nl: "Optie 2",
35+
fr: "Option 2",
36+
it: "opzione 2",
37+
es: "opcion 2",
38+
pl: "Opcja 2",
39+
"zh-cn": "选项2",
40+
},
41+
};

main.js

+36-21
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,30 @@ class Vaillant extends utils.Adapter {
109109
this.log.info("Receiving first time stats");
110110
await this.clearOldStats();
111111
await this.updateMyStats();
112-
this.updateInterval = setInterval(async () => {
113-
await this.updateMyvDevices();
114-
await this.updateMyvRooms();
115-
}, this.config.interval * 60 * 1000);
116-
this.statInterval = setInterval(async () => {
117-
//run only between 00:00 and 00:11
118-
const now = new Date();
119-
if (now.getHours() === 0 && now.getMinutes() < 11) {
120-
await this.updateMyStats();
121-
}
122-
}, 10 * 60 * 1000);
112+
this.updateInterval = setInterval(
113+
async () => {
114+
await this.updateMyvDevices();
115+
await this.updateMyvRooms();
116+
},
117+
this.config.interval * 60 * 1000,
118+
);
119+
this.statInterval = setInterval(
120+
async () => {
121+
//run only between 00:00 and 00:11
122+
const now = new Date();
123+
if (now.getHours() === 0 && now.getMinutes() < 11) {
124+
await this.updateMyStats();
125+
}
126+
},
127+
10 * 60 * 1000,
128+
);
123129
}
124-
this.refreshTokenInterval = setInterval(() => {
125-
this.refreshToken();
126-
}, ((this.session.expires_in || 3600) - 100) * 1000);
130+
this.refreshTokenInterval = setInterval(
131+
() => {
132+
this.refreshToken();
133+
},
134+
((this.session.expires_in || 3600) - 100) * 1000,
135+
);
127136
} else {
128137
this.login()
129138
.then(() => {
@@ -198,9 +207,12 @@ class Vaillant extends utils.Adapter {
198207
this.log.error("clean configuration failed");
199208
});
200209

201-
this.updateInterval = setInterval(() => {
202-
this.updateValues();
203-
}, this.config.interval * 60 * 1000);
210+
this.updateInterval = setInterval(
211+
() => {
212+
this.updateValues();
213+
},
214+
this.config.interval * 60 * 1000,
215+
);
204216
this.log.debug("Set update interval to: " + this.config.interval + "min");
205217
})
206218
.catch(() => {
@@ -901,9 +913,12 @@ class Vaillant extends utils.Adapter {
901913
this.log.debug("Login successful");
902914
this.authenticate(reject, resolve);
903915
this.reauthInterval && clearInterval(this.reauthInterval);
904-
this.reauthInterval = setInterval(() => {
905-
this.login();
906-
}, 4 * 60 * 60 * 1000); //4h;
916+
this.reauthInterval = setInterval(
917+
() => {
918+
this.login();
919+
},
920+
4 * 60 * 60 * 1000,
921+
); //4h;
907922
} catch (error) {
908923
this.log.error(JSON.stringify(error));
909924
error && this.log.error(JSON.stringify(error.stack));
@@ -1490,7 +1505,7 @@ class Vaillant extends utils.Adapter {
14901505
this.log.debug("zoneId: " + zoneId);
14911506
this.log.debug("deviceId: " + deviceId);
14921507
method = "PATCH";
1493-
const parameter = command;
1508+
let parameter = command;
14941509
if (commands[command]) {
14951510
parameter = commands[command].parameter;
14961511
}

main.test.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@ const { expect } = require("chai");
1313
// import { functionToTest } from "./moduleToTest";
1414

1515
describe("module to test => function to test", () => {
16-
// initializing logic
17-
const expected = 5;
18-
19-
it(`should return ${expected}`, () => {
20-
const result = 5;
21-
// assign result a value from functionToTest
22-
expect(result).to.equal(expected);
23-
// or using the should() syntax
24-
result.should.equal(expected);
25-
});
26-
// ... more tests => it
16+
// initializing logic
17+
const expected = 5;
2718

19+
it(`should return ${expected}`, () => {
20+
const result = 5;
21+
// assign result a value from functionToTest
22+
expect(result).to.equal(expected);
23+
// or using the should() syntax
24+
result.should.equal(expected);
25+
});
26+
// ... more tests => it
2827
});
2928

3029
// ... more test suites => describe

test/mocha.setup.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Don't silently swallow unhandled rejections
22
process.on("unhandledRejection", (e) => {
3-
throw e;
3+
throw e;
44
});
55

66
// enable the should interface with sinon
@@ -11,4 +11,4 @@ const { should, use } = require("chai");
1111

1212
should();
1313
use(sinonChai);
14-
use(chaiAsPromised);
14+
use(chaiAsPromised);

0 commit comments

Comments
 (0)