edilkamin 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +5 -1
- package/README.md +56 -1
- package/dist/cjs/package.json +4 -4
- package/dist/cjs/src/cli.js +130 -0
- package/dist/cjs/src/library.d.ts +26 -0
- package/dist/cjs/src/library.js +361 -0
- package/dist/cjs/src/library.test.js +266 -0
- package/dist/cjs/src/types.d.ts +17 -1
- package/dist/esm/package.json +4 -4
- package/dist/esm/src/cli.js +130 -0
- package/dist/esm/src/library.d.ts +26 -0
- package/dist/esm/src/library.js +361 -0
- package/dist/esm/src/library.test.js +266 -0
- package/dist/esm/src/types.d.ts +17 -1
- package/package.json +4 -4
- package/src/cli.ts +249 -0
- package/src/library.test.ts +372 -0
- package/src/library.ts +426 -0
- package/src/types.ts +20 -0
|
@@ -187,9 +187,35 @@ describe("library", () => {
|
|
|
187
187
|
"setPowerOff",
|
|
188
188
|
"setPowerOn",
|
|
189
189
|
"getPower",
|
|
190
|
+
"setPowerLevel",
|
|
191
|
+
"getPowerLevel",
|
|
192
|
+
"setFan1Speed",
|
|
193
|
+
"setFan2Speed",
|
|
194
|
+
"setFan3Speed",
|
|
195
|
+
"getFan1Speed",
|
|
196
|
+
"getFan2Speed",
|
|
197
|
+
"getFan3Speed",
|
|
198
|
+
"setAirkare",
|
|
199
|
+
"setRelax",
|
|
200
|
+
"setStandby",
|
|
201
|
+
"getStandby",
|
|
202
|
+
"setStandbyTime",
|
|
203
|
+
"getStandbyTime",
|
|
204
|
+
"setAuto",
|
|
205
|
+
"getAuto",
|
|
190
206
|
"getEnvironmentTemperature",
|
|
191
207
|
"getTargetTemperature",
|
|
192
208
|
"setTargetTemperature",
|
|
209
|
+
"setEnvironment2Temperature",
|
|
210
|
+
"getEnvironment2Temperature",
|
|
211
|
+
"setEnvironment3Temperature",
|
|
212
|
+
"getEnvironment3Temperature",
|
|
213
|
+
"setMeasureUnit",
|
|
214
|
+
"getMeasureUnit",
|
|
215
|
+
"setLanguage",
|
|
216
|
+
"getLanguage",
|
|
217
|
+
"getPelletInReserve",
|
|
218
|
+
"getPelletAutonomyTime",
|
|
193
219
|
];
|
|
194
220
|
it("should create API methods with the correct baseURL", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
195
221
|
const baseURL = "https://example.com/api/";
|
|
@@ -220,10 +246,27 @@ describe("library", () => {
|
|
|
220
246
|
temperatures: {
|
|
221
247
|
enviroment: 19,
|
|
222
248
|
},
|
|
249
|
+
flags: {
|
|
250
|
+
is_pellet_in_reserve: false,
|
|
251
|
+
},
|
|
252
|
+
pellet: {
|
|
253
|
+
autonomy_time: 180,
|
|
254
|
+
},
|
|
223
255
|
},
|
|
224
256
|
nvm: {
|
|
225
257
|
user_parameters: {
|
|
226
258
|
enviroment_1_temperature: 22,
|
|
259
|
+
enviroment_2_temperature: 18,
|
|
260
|
+
enviroment_3_temperature: 20,
|
|
261
|
+
manual_power: 3,
|
|
262
|
+
fan_1_ventilation: 2,
|
|
263
|
+
fan_2_ventilation: 3,
|
|
264
|
+
fan_3_ventilation: 4,
|
|
265
|
+
is_standby_active: true,
|
|
266
|
+
standby_waiting_time: 30,
|
|
267
|
+
is_auto: true,
|
|
268
|
+
is_fahrenheit: false,
|
|
269
|
+
language: 2,
|
|
227
270
|
},
|
|
228
271
|
},
|
|
229
272
|
};
|
|
@@ -279,6 +322,26 @@ describe("library", () => {
|
|
|
279
322
|
call: (api, token, mac) => api.getPower(token, mac),
|
|
280
323
|
expectedResult: true,
|
|
281
324
|
},
|
|
325
|
+
{
|
|
326
|
+
method: "getPowerLevel",
|
|
327
|
+
call: (api, token, mac) => api.getPowerLevel(token, mac),
|
|
328
|
+
expectedResult: 3,
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
method: "getFan1Speed",
|
|
332
|
+
call: (api, token, mac) => api.getFan1Speed(token, mac),
|
|
333
|
+
expectedResult: 2,
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
method: "getFan2Speed",
|
|
337
|
+
call: (api, token, mac) => api.getFan2Speed(token, mac),
|
|
338
|
+
expectedResult: 3,
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
method: "getFan3Speed",
|
|
342
|
+
call: (api, token, mac) => api.getFan3Speed(token, mac),
|
|
343
|
+
expectedResult: 4,
|
|
344
|
+
},
|
|
282
345
|
{
|
|
283
346
|
method: "getEnvironmentTemperature",
|
|
284
347
|
call: (api, token, mac) => api.getEnvironmentTemperature(token, mac),
|
|
@@ -289,6 +352,51 @@ describe("library", () => {
|
|
|
289
352
|
call: (api, token, mac) => api.getTargetTemperature(token, mac),
|
|
290
353
|
expectedResult: 22,
|
|
291
354
|
},
|
|
355
|
+
{
|
|
356
|
+
method: "getStandby",
|
|
357
|
+
call: (api, token, mac) => api.getStandby(token, mac),
|
|
358
|
+
expectedResult: true,
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
method: "getStandbyTime",
|
|
362
|
+
call: (api, token, mac) => api.getStandbyTime(token, mac),
|
|
363
|
+
expectedResult: 30,
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
method: "getAuto",
|
|
367
|
+
call: (api, token, mac) => api.getAuto(token, mac),
|
|
368
|
+
expectedResult: true,
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
method: "getEnvironment2Temperature",
|
|
372
|
+
call: (api, token, mac) => api.getEnvironment2Temperature(token, mac),
|
|
373
|
+
expectedResult: 18,
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
method: "getEnvironment3Temperature",
|
|
377
|
+
call: (api, token, mac) => api.getEnvironment3Temperature(token, mac),
|
|
378
|
+
expectedResult: 20,
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
method: "getMeasureUnit",
|
|
382
|
+
call: (api, token, mac) => api.getMeasureUnit(token, mac),
|
|
383
|
+
expectedResult: false,
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
method: "getLanguage",
|
|
387
|
+
call: (api, token, mac) => api.getLanguage(token, mac),
|
|
388
|
+
expectedResult: 2,
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
method: "getPelletInReserve",
|
|
392
|
+
call: (api, token, mac) => api.getPelletInReserve(token, mac),
|
|
393
|
+
expectedResult: false,
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
method: "getPelletAutonomyTime",
|
|
397
|
+
call: (api, token, mac) => api.getPelletAutonomyTime(token, mac),
|
|
398
|
+
expectedResult: 180,
|
|
399
|
+
},
|
|
292
400
|
];
|
|
293
401
|
getterTests.forEach(({ method, call, expectedResult }) => {
|
|
294
402
|
it(`should call fetch and return the correct value for ${method}`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -306,6 +414,38 @@ describe("library", () => {
|
|
|
306
414
|
});
|
|
307
415
|
// Setter tests
|
|
308
416
|
const setterTests = [
|
|
417
|
+
{
|
|
418
|
+
method: "setPowerLevel",
|
|
419
|
+
call: (api, token, mac, value) => api.setPowerLevel(token, mac, value),
|
|
420
|
+
payload: {
|
|
421
|
+
name: "power_level",
|
|
422
|
+
value: 4,
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
method: "setFan1Speed",
|
|
427
|
+
call: (api, token, mac, value) => api.setFan1Speed(token, mac, value),
|
|
428
|
+
payload: {
|
|
429
|
+
name: "fan_1_speed",
|
|
430
|
+
value: 3,
|
|
431
|
+
},
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
method: "setFan2Speed",
|
|
435
|
+
call: (api, token, mac, value) => api.setFan2Speed(token, mac, value),
|
|
436
|
+
payload: {
|
|
437
|
+
name: "fan_2_speed",
|
|
438
|
+
value: 4,
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
method: "setFan3Speed",
|
|
443
|
+
call: (api, token, mac, value) => api.setFan3Speed(token, mac, value),
|
|
444
|
+
payload: {
|
|
445
|
+
name: "fan_3_speed",
|
|
446
|
+
value: 5,
|
|
447
|
+
},
|
|
448
|
+
},
|
|
309
449
|
{
|
|
310
450
|
method: "setTargetTemperature",
|
|
311
451
|
call: (api, token, mac, value) => api.setTargetTemperature(token, mac, value),
|
|
@@ -314,6 +454,38 @@ describe("library", () => {
|
|
|
314
454
|
value: 20,
|
|
315
455
|
},
|
|
316
456
|
},
|
|
457
|
+
{
|
|
458
|
+
method: "setStandbyTime",
|
|
459
|
+
call: (api, token, mac, value) => api.setStandbyTime(token, mac, value),
|
|
460
|
+
payload: {
|
|
461
|
+
name: "standby_time",
|
|
462
|
+
value: 45,
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
method: "setEnvironment2Temperature",
|
|
467
|
+
call: (api, token, mac, value) => api.setEnvironment2Temperature(token, mac, value),
|
|
468
|
+
payload: {
|
|
469
|
+
name: "enviroment_2_temperature",
|
|
470
|
+
value: 21,
|
|
471
|
+
},
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
method: "setEnvironment3Temperature",
|
|
475
|
+
call: (api, token, mac, value) => api.setEnvironment3Temperature(token, mac, value),
|
|
476
|
+
payload: {
|
|
477
|
+
name: "enviroment_3_temperature",
|
|
478
|
+
value: 23,
|
|
479
|
+
},
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
method: "setLanguage",
|
|
483
|
+
call: (api, token, mac, value) => api.setLanguage(token, mac, value),
|
|
484
|
+
payload: {
|
|
485
|
+
name: "language",
|
|
486
|
+
value: 2,
|
|
487
|
+
},
|
|
488
|
+
},
|
|
317
489
|
];
|
|
318
490
|
setterTests.forEach(({ method, call, payload }) => {
|
|
319
491
|
it(`should call fetch and send the correct payload for ${method}`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -332,6 +504,69 @@ describe("library", () => {
|
|
|
332
504
|
});
|
|
333
505
|
}));
|
|
334
506
|
});
|
|
507
|
+
// Boolean setter tests (for mode controls)
|
|
508
|
+
const booleanSetterTests = [
|
|
509
|
+
{
|
|
510
|
+
method: "setAirkare",
|
|
511
|
+
call: (api, token, mac, enabled) => api.setAirkare(token, mac, enabled),
|
|
512
|
+
truePayload: { name: "airkare_function", value: 1 },
|
|
513
|
+
falsePayload: { name: "airkare_function", value: 0 },
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
method: "setRelax",
|
|
517
|
+
call: (api, token, mac, enabled) => api.setRelax(token, mac, enabled),
|
|
518
|
+
truePayload: { name: "relax_mode", value: true },
|
|
519
|
+
falsePayload: { name: "relax_mode", value: false },
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
method: "setStandby",
|
|
523
|
+
call: (api, token, mac, enabled) => api.setStandby(token, mac, enabled),
|
|
524
|
+
truePayload: { name: "standby_mode", value: true },
|
|
525
|
+
falsePayload: { name: "standby_mode", value: false },
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
method: "setAuto",
|
|
529
|
+
call: (api, token, mac, enabled) => api.setAuto(token, mac, enabled),
|
|
530
|
+
truePayload: { name: "auto_mode", value: true },
|
|
531
|
+
falsePayload: { name: "auto_mode", value: false },
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
method: "setMeasureUnit",
|
|
535
|
+
call: (api, token, mac, enabled) => api.setMeasureUnit(token, mac, enabled),
|
|
536
|
+
truePayload: { name: "measure_unit", value: true },
|
|
537
|
+
falsePayload: { name: "measure_unit", value: false },
|
|
538
|
+
},
|
|
539
|
+
];
|
|
540
|
+
booleanSetterTests.forEach(({ method, call, truePayload, falsePayload }) => {
|
|
541
|
+
it(`should call fetch with correct payload for ${method}(true)`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
542
|
+
fetchStub.resolves(mockResponse({ success: true }));
|
|
543
|
+
const api = (0, library_1.configure)("https://example.com/api/");
|
|
544
|
+
yield call(api, expectedToken, "mockMacAddress", true);
|
|
545
|
+
assert_1.strict.ok(fetchStub.calledOnce);
|
|
546
|
+
assert_1.strict.deepEqual(fetchStub.firstCall.args[1], {
|
|
547
|
+
method: "PUT",
|
|
548
|
+
headers: {
|
|
549
|
+
"Content-Type": "application/json",
|
|
550
|
+
Authorization: `Bearer ${expectedToken}`,
|
|
551
|
+
},
|
|
552
|
+
body: JSON.stringify(Object.assign({ mac_address: "mockMacAddress" }, truePayload)),
|
|
553
|
+
});
|
|
554
|
+
}));
|
|
555
|
+
it(`should call fetch with correct payload for ${method}(false)`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
556
|
+
fetchStub.resolves(mockResponse({ success: true }));
|
|
557
|
+
const api = (0, library_1.configure)("https://example.com/api/");
|
|
558
|
+
yield call(api, expectedToken, "mockMacAddress", false);
|
|
559
|
+
assert_1.strict.ok(fetchStub.calledOnce);
|
|
560
|
+
assert_1.strict.deepEqual(fetchStub.firstCall.args[1], {
|
|
561
|
+
method: "PUT",
|
|
562
|
+
headers: {
|
|
563
|
+
"Content-Type": "application/json",
|
|
564
|
+
Authorization: `Bearer ${expectedToken}`,
|
|
565
|
+
},
|
|
566
|
+
body: JSON.stringify(Object.assign({ mac_address: "mockMacAddress" }, falsePayload)),
|
|
567
|
+
});
|
|
568
|
+
}));
|
|
569
|
+
});
|
|
335
570
|
});
|
|
336
571
|
describe("registerDevice", () => {
|
|
337
572
|
it("should call POST /device with correct payload", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -520,6 +755,37 @@ describe("library", () => {
|
|
|
520
755
|
const result = yield api.getTargetTemperature(expectedToken, "mockMacAddress");
|
|
521
756
|
assert_1.strict.equal(result, 22);
|
|
522
757
|
}));
|
|
758
|
+
it("should work with getPelletInReserve on compressed response", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
759
|
+
const statusData = {
|
|
760
|
+
commands: { power: true },
|
|
761
|
+
temperatures: { enviroment: 19 },
|
|
762
|
+
flags: { is_pellet_in_reserve: true },
|
|
763
|
+
pellet: { autonomy_time: 120 },
|
|
764
|
+
};
|
|
765
|
+
const mockResponseData = {
|
|
766
|
+
status: createGzippedBuffer(statusData),
|
|
767
|
+
nvm: { user_parameters: { enviroment_1_temperature: 22 } },
|
|
768
|
+
};
|
|
769
|
+
fetchStub.resolves(mockResponse(mockResponseData));
|
|
770
|
+
const api = (0, library_1.configure)("https://example.com/api/");
|
|
771
|
+
const result = yield api.getPelletInReserve(expectedToken, "mockMacAddress");
|
|
772
|
+
assert_1.strict.equal(result, true);
|
|
773
|
+
}));
|
|
774
|
+
it("should work with getPelletAutonomyTime on response", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
775
|
+
const mockResponseData = {
|
|
776
|
+
status: {
|
|
777
|
+
commands: { power: true },
|
|
778
|
+
temperatures: { enviroment: 19 },
|
|
779
|
+
flags: { is_pellet_in_reserve: false },
|
|
780
|
+
pellet: { autonomy_time: 240 },
|
|
781
|
+
},
|
|
782
|
+
nvm: { user_parameters: { enviroment_1_temperature: 22 } },
|
|
783
|
+
};
|
|
784
|
+
fetchStub.resolves(mockResponse(mockResponseData));
|
|
785
|
+
const api = (0, library_1.configure)("https://example.com/api/");
|
|
786
|
+
const result = yield api.getPelletAutonomyTime(expectedToken, "mockMacAddress");
|
|
787
|
+
assert_1.strict.equal(result, 240);
|
|
788
|
+
}));
|
|
523
789
|
});
|
|
524
790
|
describe("Error Handling", () => {
|
|
525
791
|
const errorTests = [
|
package/dist/cjs/src/types.d.ts
CHANGED
|
@@ -13,9 +13,17 @@ interface TemperaturesType {
|
|
|
13
13
|
board: number;
|
|
14
14
|
enviroment: number;
|
|
15
15
|
}
|
|
16
|
+
interface GeneralFlagsType {
|
|
17
|
+
is_pellet_in_reserve: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface PelletAutonomyType {
|
|
20
|
+
autonomy_time: number;
|
|
21
|
+
}
|
|
16
22
|
interface StatusType {
|
|
17
23
|
commands: CommandsType;
|
|
18
24
|
temperatures: TemperaturesType;
|
|
25
|
+
flags: GeneralFlagsType;
|
|
26
|
+
pellet: PelletAutonomyType;
|
|
19
27
|
}
|
|
20
28
|
interface UserParametersType {
|
|
21
29
|
enviroment_1_temperature: number;
|
|
@@ -23,6 +31,14 @@ interface UserParametersType {
|
|
|
23
31
|
enviroment_3_temperature: number;
|
|
24
32
|
is_auto: boolean;
|
|
25
33
|
is_sound_active: boolean;
|
|
34
|
+
manual_power: number;
|
|
35
|
+
fan_1_ventilation: number;
|
|
36
|
+
fan_2_ventilation: number;
|
|
37
|
+
fan_3_ventilation: number;
|
|
38
|
+
is_standby_active: boolean;
|
|
39
|
+
standby_waiting_time: number;
|
|
40
|
+
is_fahrenheit: boolean;
|
|
41
|
+
language: number;
|
|
26
42
|
}
|
|
27
43
|
interface DeviceInfoType {
|
|
28
44
|
status: StatusType;
|
|
@@ -83,4 +99,4 @@ interface DiscoveredDevice {
|
|
|
83
99
|
/** Signal strength in dBm (optional, not all platforms provide this) */
|
|
84
100
|
rssi?: number;
|
|
85
101
|
}
|
|
86
|
-
export type { BufferEncodedType, CommandsType, DeviceAssociationBody, DeviceAssociationResponse, DeviceInfoRawType, DeviceInfoType, DiscoveredDevice, EditDeviceAssociationBody, StatusType, TemperaturesType, UserParametersType, };
|
|
102
|
+
export type { BufferEncodedType, CommandsType, DeviceAssociationBody, DeviceAssociationResponse, DeviceInfoRawType, DeviceInfoType, DiscoveredDevice, EditDeviceAssociationBody, GeneralFlagsType, PelletAutonomyType, StatusType, TemperaturesType, UserParametersType, };
|
package/dist/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edilkamin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/src/index.js",
|
|
6
6
|
"module": "dist/esm/src/index.js",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"@eslint/eslintrc": "^3.2.0",
|
|
71
71
|
"@eslint/js": "^9.16.0",
|
|
72
72
|
"@types/mocha": "^10.0.10",
|
|
73
|
-
"@types/node": "^
|
|
73
|
+
"@types/node": "^24",
|
|
74
74
|
"@types/pako": "^2.0.4",
|
|
75
|
-
"@types/sinon": "^
|
|
75
|
+
"@types/sinon": "^21.0.0",
|
|
76
76
|
"@types/web-bluetooth": "^0.0.21",
|
|
77
77
|
"@typescript-eslint/eslint-plugin": "^8.17.0",
|
|
78
78
|
"@typescript-eslint/parser": "^8.17.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"mocha": "^11.7.5",
|
|
85
85
|
"nyc": "^17.1.0",
|
|
86
86
|
"prettier": "^3.7.4",
|
|
87
|
-
"sinon": "^
|
|
87
|
+
"sinon": "^21.0.1",
|
|
88
88
|
"ts-node": "^10.9.1",
|
|
89
89
|
"typedoc": "^0.28.15",
|
|
90
90
|
"typescript": "^5.7.2"
|
package/dist/esm/src/cli.js
CHANGED
|
@@ -147,6 +147,11 @@ const createProgram = () => {
|
|
|
147
147
|
description: "Retrieve device power status",
|
|
148
148
|
getter: (api, jwtToken, mac) => api.getPower(jwtToken, mac),
|
|
149
149
|
},
|
|
150
|
+
{
|
|
151
|
+
commandName: "getPowerLevel",
|
|
152
|
+
description: "Retrieve manual power level (1-5)",
|
|
153
|
+
getter: (api, jwtToken, mac) => api.getPowerLevel(jwtToken, mac),
|
|
154
|
+
},
|
|
150
155
|
{
|
|
151
156
|
commandName: "getEnvironmentTemperature",
|
|
152
157
|
description: "Retrieve environment temperature",
|
|
@@ -157,6 +162,66 @@ const createProgram = () => {
|
|
|
157
162
|
description: "Retrieve target temperature",
|
|
158
163
|
getter: (api, jwtToken, mac) => api.getTargetTemperature(jwtToken, mac),
|
|
159
164
|
},
|
|
165
|
+
{
|
|
166
|
+
commandName: "getFan1Speed",
|
|
167
|
+
description: "Retrieve fan 1 speed",
|
|
168
|
+
getter: (api, jwtToken, mac) => api.getFan1Speed(jwtToken, mac),
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
commandName: "getFan2Speed",
|
|
172
|
+
description: "Retrieve fan 2 speed",
|
|
173
|
+
getter: (api, jwtToken, mac) => api.getFan2Speed(jwtToken, mac),
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
commandName: "getFan3Speed",
|
|
177
|
+
description: "Retrieve fan 3 speed",
|
|
178
|
+
getter: (api, jwtToken, mac) => api.getFan3Speed(jwtToken, mac),
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
commandName: "getStandby",
|
|
182
|
+
description: "Retrieve Standby mode status",
|
|
183
|
+
getter: (api, jwtToken, mac) => api.getStandby(jwtToken, mac),
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
commandName: "getStandbyTime",
|
|
187
|
+
description: "Retrieve standby waiting time in minutes",
|
|
188
|
+
getter: (api, jwtToken, mac) => api.getStandbyTime(jwtToken, mac),
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
commandName: "getAuto",
|
|
192
|
+
description: "Retrieve Auto mode status",
|
|
193
|
+
getter: (api, jwtToken, mac) => api.getAuto(jwtToken, mac),
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
commandName: "getEnvironment2Temperature",
|
|
197
|
+
description: "Retrieve Environment 2 target temperature",
|
|
198
|
+
getter: (api, jwtToken, mac) => api.getEnvironment2Temperature(jwtToken, mac),
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
commandName: "getEnvironment3Temperature",
|
|
202
|
+
description: "Retrieve Environment 3 target temperature",
|
|
203
|
+
getter: (api, jwtToken, mac) => api.getEnvironment3Temperature(jwtToken, mac),
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
commandName: "getMeasureUnit",
|
|
207
|
+
description: "Retrieve temperature unit (true=Fahrenheit, false=Celsius)",
|
|
208
|
+
getter: (api, jwtToken, mac) => api.getMeasureUnit(jwtToken, mac),
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
commandName: "getLanguage",
|
|
212
|
+
description: "Retrieve display language code (0-9)",
|
|
213
|
+
getter: (api, jwtToken, mac) => api.getLanguage(jwtToken, mac),
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
commandName: "getPelletInReserve",
|
|
217
|
+
description: "Retrieve pellet reserve status (true=low/reserve, false=ok)",
|
|
218
|
+
getter: (api, jwtToken, mac) => api.getPelletInReserve(jwtToken, mac),
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
commandName: "getPelletAutonomyTime",
|
|
222
|
+
description: "Retrieve estimated pellet autonomy time",
|
|
223
|
+
getter: (api, jwtToken, mac) => api.getPelletAutonomyTime(jwtToken, mac),
|
|
224
|
+
},
|
|
160
225
|
].forEach(({ commandName, description, getter }) => {
|
|
161
226
|
addLegacyOption(addMacOption(addAuthOptions(program.command(commandName).description(description)))).action((options) => executeGetter(options, getter));
|
|
162
227
|
});
|
|
@@ -167,11 +232,76 @@ const createProgram = () => {
|
|
|
167
232
|
description: "Set the power state of the device (1 for ON, 0 for OFF)",
|
|
168
233
|
setter: (api, jwtToken, mac, value) => api.setPower(jwtToken, mac, value),
|
|
169
234
|
},
|
|
235
|
+
{
|
|
236
|
+
commandName: "setPowerLevel",
|
|
237
|
+
description: "Set manual power level (1-5)",
|
|
238
|
+
setter: (api, jwtToken, mac, value) => api.setPowerLevel(jwtToken, mac, value),
|
|
239
|
+
},
|
|
170
240
|
{
|
|
171
241
|
commandName: "setTargetTemperature",
|
|
172
242
|
description: "Set the target temperature (degree celsius) for a device",
|
|
173
243
|
setter: (api, jwtToken, mac, value) => api.setTargetTemperature(jwtToken, mac, value),
|
|
174
244
|
},
|
|
245
|
+
{
|
|
246
|
+
commandName: "setFan1Speed",
|
|
247
|
+
description: "Set fan 1 speed (0-5)",
|
|
248
|
+
setter: (api, jwtToken, mac, value) => api.setFan1Speed(jwtToken, mac, value),
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
commandName: "setFan2Speed",
|
|
252
|
+
description: "Set fan 2 speed (0-5)",
|
|
253
|
+
setter: (api, jwtToken, mac, value) => api.setFan2Speed(jwtToken, mac, value),
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
commandName: "setFan3Speed",
|
|
257
|
+
description: "Set fan 3 speed (0-5)",
|
|
258
|
+
setter: (api, jwtToken, mac, value) => api.setFan3Speed(jwtToken, mac, value),
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
commandName: "setAirkare",
|
|
262
|
+
description: "Enable/disable Airkare mode (1=on, 0=off)",
|
|
263
|
+
setter: (api, jwtToken, mac, value) => api.setAirkare(jwtToken, mac, value === 1),
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
commandName: "setRelax",
|
|
267
|
+
description: "Enable/disable Relax mode (1=on, 0=off)",
|
|
268
|
+
setter: (api, jwtToken, mac, value) => api.setRelax(jwtToken, mac, value === 1),
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
commandName: "setStandby",
|
|
272
|
+
description: "Enable/disable Standby mode (1=on, 0=off)",
|
|
273
|
+
setter: (api, jwtToken, mac, value) => api.setStandby(jwtToken, mac, value === 1),
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
commandName: "setStandbyTime",
|
|
277
|
+
description: "Set standby waiting time in minutes",
|
|
278
|
+
setter: (api, jwtToken, mac, value) => api.setStandbyTime(jwtToken, mac, value),
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
commandName: "setAuto",
|
|
282
|
+
description: "Enable/disable Auto mode (1=on, 0=off)",
|
|
283
|
+
setter: (api, jwtToken, mac, value) => api.setAuto(jwtToken, mac, value === 1),
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
commandName: "setEnvironment2Temperature",
|
|
287
|
+
description: "Set Environment 2 target temperature (degrees Celsius)",
|
|
288
|
+
setter: (api, jwtToken, mac, value) => api.setEnvironment2Temperature(jwtToken, mac, value),
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
commandName: "setEnvironment3Temperature",
|
|
292
|
+
description: "Set Environment 3 target temperature (degrees Celsius)",
|
|
293
|
+
setter: (api, jwtToken, mac, value) => api.setEnvironment3Temperature(jwtToken, mac, value),
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
commandName: "setMeasureUnit",
|
|
297
|
+
description: "Set temperature unit (1=Fahrenheit, 0=Celsius)",
|
|
298
|
+
setter: (api, jwtToken, mac, value) => api.setMeasureUnit(jwtToken, mac, value === 1),
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
commandName: "setLanguage",
|
|
302
|
+
description: "Set display language (0=IT,1=FR,2=EN,3=ES,4=PT,5=DA,6=NL,7=DE,8=HU,9=PL)",
|
|
303
|
+
setter: (api, jwtToken, mac, value) => api.setLanguage(jwtToken, mac, value),
|
|
304
|
+
},
|
|
175
305
|
].forEach(({ commandName, description, setter }) => {
|
|
176
306
|
addLegacyOption(addMacOption(addAuthOptions(program.command(commandName).description(description)).requiredOption("-v, --value <number>", "Value to set", parseFloat))).action((options) => executeSetter(options, setter));
|
|
177
307
|
});
|
|
@@ -48,8 +48,34 @@ declare const configure: (baseURL?: string) => {
|
|
|
48
48
|
setPowerOff: (jwtToken: string, macAddress: string) => Promise<unknown>;
|
|
49
49
|
setPowerOn: (jwtToken: string, macAddress: string) => Promise<unknown>;
|
|
50
50
|
getPower: (jwtToken: string, macAddress: string) => Promise<boolean>;
|
|
51
|
+
setPowerLevel: (jwtToken: string, macAddress: string, level: number) => Promise<unknown>;
|
|
52
|
+
getPowerLevel: (jwtToken: string, macAddress: string) => Promise<number>;
|
|
53
|
+
setFan1Speed: (jwtToken: string, macAddress: string, speed: number) => Promise<unknown>;
|
|
54
|
+
setFan2Speed: (jwtToken: string, macAddress: string, speed: number) => Promise<unknown>;
|
|
55
|
+
setFan3Speed: (jwtToken: string, macAddress: string, speed: number) => Promise<unknown>;
|
|
56
|
+
getFan1Speed: (jwtToken: string, macAddress: string) => Promise<number>;
|
|
57
|
+
getFan2Speed: (jwtToken: string, macAddress: string) => Promise<number>;
|
|
58
|
+
getFan3Speed: (jwtToken: string, macAddress: string) => Promise<number>;
|
|
59
|
+
setAirkare: (jwtToken: string, macAddress: string, enabled: boolean) => Promise<unknown>;
|
|
60
|
+
setRelax: (jwtToken: string, macAddress: string, enabled: boolean) => Promise<unknown>;
|
|
61
|
+
setStandby: (jwtToken: string, macAddress: string, enabled: boolean) => Promise<unknown>;
|
|
62
|
+
getStandby: (jwtToken: string, macAddress: string) => Promise<boolean>;
|
|
63
|
+
setStandbyTime: (jwtToken: string, macAddress: string, minutes: number) => Promise<unknown>;
|
|
64
|
+
getStandbyTime: (jwtToken: string, macAddress: string) => Promise<number>;
|
|
65
|
+
setAuto: (jwtToken: string, macAddress: string, enabled: boolean) => Promise<unknown>;
|
|
66
|
+
getAuto: (jwtToken: string, macAddress: string) => Promise<boolean>;
|
|
51
67
|
getEnvironmentTemperature: (jwtToken: string, macAddress: string) => Promise<number>;
|
|
52
68
|
getTargetTemperature: (jwtToken: string, macAddress: string) => Promise<number>;
|
|
53
69
|
setTargetTemperature: (jwtToken: string, macAddress: string, temperature: number) => Promise<unknown>;
|
|
70
|
+
setEnvironment2Temperature: (jwtToken: string, macAddress: string, temperature: number) => Promise<unknown>;
|
|
71
|
+
getEnvironment2Temperature: (jwtToken: string, macAddress: string) => Promise<number>;
|
|
72
|
+
setEnvironment3Temperature: (jwtToken: string, macAddress: string, temperature: number) => Promise<unknown>;
|
|
73
|
+
getEnvironment3Temperature: (jwtToken: string, macAddress: string) => Promise<number>;
|
|
74
|
+
setMeasureUnit: (jwtToken: string, macAddress: string, isFahrenheit: boolean) => Promise<unknown>;
|
|
75
|
+
getMeasureUnit: (jwtToken: string, macAddress: string) => Promise<boolean>;
|
|
76
|
+
setLanguage: (jwtToken: string, macAddress: string, languageCode: number) => Promise<unknown>;
|
|
77
|
+
getLanguage: (jwtToken: string, macAddress: string) => Promise<number>;
|
|
78
|
+
getPelletInReserve: (jwtToken: string, macAddress: string) => Promise<boolean>;
|
|
79
|
+
getPelletAutonomyTime: (jwtToken: string, macAddress: string) => Promise<number>;
|
|
54
80
|
};
|
|
55
81
|
export { configure, configureAmplify, createAuthService, getSession, headers, signIn, };
|