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.
@@ -182,9 +182,35 @@ describe("library", () => {
182
182
  "setPowerOff",
183
183
  "setPowerOn",
184
184
  "getPower",
185
+ "setPowerLevel",
186
+ "getPowerLevel",
187
+ "setFan1Speed",
188
+ "setFan2Speed",
189
+ "setFan3Speed",
190
+ "getFan1Speed",
191
+ "getFan2Speed",
192
+ "getFan3Speed",
193
+ "setAirkare",
194
+ "setRelax",
195
+ "setStandby",
196
+ "getStandby",
197
+ "setStandbyTime",
198
+ "getStandbyTime",
199
+ "setAuto",
200
+ "getAuto",
185
201
  "getEnvironmentTemperature",
186
202
  "getTargetTemperature",
187
203
  "setTargetTemperature",
204
+ "setEnvironment2Temperature",
205
+ "getEnvironment2Temperature",
206
+ "setEnvironment3Temperature",
207
+ "getEnvironment3Temperature",
208
+ "setMeasureUnit",
209
+ "getMeasureUnit",
210
+ "setLanguage",
211
+ "getLanguage",
212
+ "getPelletInReserve",
213
+ "getPelletAutonomyTime",
188
214
  ];
189
215
  it("should create API methods with the correct baseURL", () => __awaiter(void 0, void 0, void 0, function* () {
190
216
  const baseURL = "https://example.com/api/";
@@ -215,10 +241,27 @@ describe("library", () => {
215
241
  temperatures: {
216
242
  enviroment: 19,
217
243
  },
244
+ flags: {
245
+ is_pellet_in_reserve: false,
246
+ },
247
+ pellet: {
248
+ autonomy_time: 180,
249
+ },
218
250
  },
219
251
  nvm: {
220
252
  user_parameters: {
221
253
  enviroment_1_temperature: 22,
254
+ enviroment_2_temperature: 18,
255
+ enviroment_3_temperature: 20,
256
+ manual_power: 3,
257
+ fan_1_ventilation: 2,
258
+ fan_2_ventilation: 3,
259
+ fan_3_ventilation: 4,
260
+ is_standby_active: true,
261
+ standby_waiting_time: 30,
262
+ is_auto: true,
263
+ is_fahrenheit: false,
264
+ language: 2,
222
265
  },
223
266
  },
224
267
  };
@@ -274,6 +317,26 @@ describe("library", () => {
274
317
  call: (api, token, mac) => api.getPower(token, mac),
275
318
  expectedResult: true,
276
319
  },
320
+ {
321
+ method: "getPowerLevel",
322
+ call: (api, token, mac) => api.getPowerLevel(token, mac),
323
+ expectedResult: 3,
324
+ },
325
+ {
326
+ method: "getFan1Speed",
327
+ call: (api, token, mac) => api.getFan1Speed(token, mac),
328
+ expectedResult: 2,
329
+ },
330
+ {
331
+ method: "getFan2Speed",
332
+ call: (api, token, mac) => api.getFan2Speed(token, mac),
333
+ expectedResult: 3,
334
+ },
335
+ {
336
+ method: "getFan3Speed",
337
+ call: (api, token, mac) => api.getFan3Speed(token, mac),
338
+ expectedResult: 4,
339
+ },
277
340
  {
278
341
  method: "getEnvironmentTemperature",
279
342
  call: (api, token, mac) => api.getEnvironmentTemperature(token, mac),
@@ -284,6 +347,51 @@ describe("library", () => {
284
347
  call: (api, token, mac) => api.getTargetTemperature(token, mac),
285
348
  expectedResult: 22,
286
349
  },
350
+ {
351
+ method: "getStandby",
352
+ call: (api, token, mac) => api.getStandby(token, mac),
353
+ expectedResult: true,
354
+ },
355
+ {
356
+ method: "getStandbyTime",
357
+ call: (api, token, mac) => api.getStandbyTime(token, mac),
358
+ expectedResult: 30,
359
+ },
360
+ {
361
+ method: "getAuto",
362
+ call: (api, token, mac) => api.getAuto(token, mac),
363
+ expectedResult: true,
364
+ },
365
+ {
366
+ method: "getEnvironment2Temperature",
367
+ call: (api, token, mac) => api.getEnvironment2Temperature(token, mac),
368
+ expectedResult: 18,
369
+ },
370
+ {
371
+ method: "getEnvironment3Temperature",
372
+ call: (api, token, mac) => api.getEnvironment3Temperature(token, mac),
373
+ expectedResult: 20,
374
+ },
375
+ {
376
+ method: "getMeasureUnit",
377
+ call: (api, token, mac) => api.getMeasureUnit(token, mac),
378
+ expectedResult: false,
379
+ },
380
+ {
381
+ method: "getLanguage",
382
+ call: (api, token, mac) => api.getLanguage(token, mac),
383
+ expectedResult: 2,
384
+ },
385
+ {
386
+ method: "getPelletInReserve",
387
+ call: (api, token, mac) => api.getPelletInReserve(token, mac),
388
+ expectedResult: false,
389
+ },
390
+ {
391
+ method: "getPelletAutonomyTime",
392
+ call: (api, token, mac) => api.getPelletAutonomyTime(token, mac),
393
+ expectedResult: 180,
394
+ },
287
395
  ];
288
396
  getterTests.forEach(({ method, call, expectedResult }) => {
289
397
  it(`should call fetch and return the correct value for ${method}`, () => __awaiter(void 0, void 0, void 0, function* () {
@@ -301,6 +409,38 @@ describe("library", () => {
301
409
  });
302
410
  // Setter tests
303
411
  const setterTests = [
412
+ {
413
+ method: "setPowerLevel",
414
+ call: (api, token, mac, value) => api.setPowerLevel(token, mac, value),
415
+ payload: {
416
+ name: "power_level",
417
+ value: 4,
418
+ },
419
+ },
420
+ {
421
+ method: "setFan1Speed",
422
+ call: (api, token, mac, value) => api.setFan1Speed(token, mac, value),
423
+ payload: {
424
+ name: "fan_1_speed",
425
+ value: 3,
426
+ },
427
+ },
428
+ {
429
+ method: "setFan2Speed",
430
+ call: (api, token, mac, value) => api.setFan2Speed(token, mac, value),
431
+ payload: {
432
+ name: "fan_2_speed",
433
+ value: 4,
434
+ },
435
+ },
436
+ {
437
+ method: "setFan3Speed",
438
+ call: (api, token, mac, value) => api.setFan3Speed(token, mac, value),
439
+ payload: {
440
+ name: "fan_3_speed",
441
+ value: 5,
442
+ },
443
+ },
304
444
  {
305
445
  method: "setTargetTemperature",
306
446
  call: (api, token, mac, value) => api.setTargetTemperature(token, mac, value),
@@ -309,6 +449,38 @@ describe("library", () => {
309
449
  value: 20,
310
450
  },
311
451
  },
452
+ {
453
+ method: "setStandbyTime",
454
+ call: (api, token, mac, value) => api.setStandbyTime(token, mac, value),
455
+ payload: {
456
+ name: "standby_time",
457
+ value: 45,
458
+ },
459
+ },
460
+ {
461
+ method: "setEnvironment2Temperature",
462
+ call: (api, token, mac, value) => api.setEnvironment2Temperature(token, mac, value),
463
+ payload: {
464
+ name: "enviroment_2_temperature",
465
+ value: 21,
466
+ },
467
+ },
468
+ {
469
+ method: "setEnvironment3Temperature",
470
+ call: (api, token, mac, value) => api.setEnvironment3Temperature(token, mac, value),
471
+ payload: {
472
+ name: "enviroment_3_temperature",
473
+ value: 23,
474
+ },
475
+ },
476
+ {
477
+ method: "setLanguage",
478
+ call: (api, token, mac, value) => api.setLanguage(token, mac, value),
479
+ payload: {
480
+ name: "language",
481
+ value: 2,
482
+ },
483
+ },
312
484
  ];
313
485
  setterTests.forEach(({ method, call, payload }) => {
314
486
  it(`should call fetch and send the correct payload for ${method}`, () => __awaiter(void 0, void 0, void 0, function* () {
@@ -327,6 +499,69 @@ describe("library", () => {
327
499
  });
328
500
  }));
329
501
  });
502
+ // Boolean setter tests (for mode controls)
503
+ const booleanSetterTests = [
504
+ {
505
+ method: "setAirkare",
506
+ call: (api, token, mac, enabled) => api.setAirkare(token, mac, enabled),
507
+ truePayload: { name: "airkare_function", value: 1 },
508
+ falsePayload: { name: "airkare_function", value: 0 },
509
+ },
510
+ {
511
+ method: "setRelax",
512
+ call: (api, token, mac, enabled) => api.setRelax(token, mac, enabled),
513
+ truePayload: { name: "relax_mode", value: true },
514
+ falsePayload: { name: "relax_mode", value: false },
515
+ },
516
+ {
517
+ method: "setStandby",
518
+ call: (api, token, mac, enabled) => api.setStandby(token, mac, enabled),
519
+ truePayload: { name: "standby_mode", value: true },
520
+ falsePayload: { name: "standby_mode", value: false },
521
+ },
522
+ {
523
+ method: "setAuto",
524
+ call: (api, token, mac, enabled) => api.setAuto(token, mac, enabled),
525
+ truePayload: { name: "auto_mode", value: true },
526
+ falsePayload: { name: "auto_mode", value: false },
527
+ },
528
+ {
529
+ method: "setMeasureUnit",
530
+ call: (api, token, mac, enabled) => api.setMeasureUnit(token, mac, enabled),
531
+ truePayload: { name: "measure_unit", value: true },
532
+ falsePayload: { name: "measure_unit", value: false },
533
+ },
534
+ ];
535
+ booleanSetterTests.forEach(({ method, call, truePayload, falsePayload }) => {
536
+ it(`should call fetch with correct payload for ${method}(true)`, () => __awaiter(void 0, void 0, void 0, function* () {
537
+ fetchStub.resolves(mockResponse({ success: true }));
538
+ const api = configure("https://example.com/api/");
539
+ yield call(api, expectedToken, "mockMacAddress", true);
540
+ assert.ok(fetchStub.calledOnce);
541
+ assert.deepEqual(fetchStub.firstCall.args[1], {
542
+ method: "PUT",
543
+ headers: {
544
+ "Content-Type": "application/json",
545
+ Authorization: `Bearer ${expectedToken}`,
546
+ },
547
+ body: JSON.stringify(Object.assign({ mac_address: "mockMacAddress" }, truePayload)),
548
+ });
549
+ }));
550
+ it(`should call fetch with correct payload for ${method}(false)`, () => __awaiter(void 0, void 0, void 0, function* () {
551
+ fetchStub.resolves(mockResponse({ success: true }));
552
+ const api = configure("https://example.com/api/");
553
+ yield call(api, expectedToken, "mockMacAddress", false);
554
+ assert.ok(fetchStub.calledOnce);
555
+ assert.deepEqual(fetchStub.firstCall.args[1], {
556
+ method: "PUT",
557
+ headers: {
558
+ "Content-Type": "application/json",
559
+ Authorization: `Bearer ${expectedToken}`,
560
+ },
561
+ body: JSON.stringify(Object.assign({ mac_address: "mockMacAddress" }, falsePayload)),
562
+ });
563
+ }));
564
+ });
330
565
  });
331
566
  describe("registerDevice", () => {
332
567
  it("should call POST /device with correct payload", () => __awaiter(void 0, void 0, void 0, function* () {
@@ -515,6 +750,37 @@ describe("library", () => {
515
750
  const result = yield api.getTargetTemperature(expectedToken, "mockMacAddress");
516
751
  assert.equal(result, 22);
517
752
  }));
753
+ it("should work with getPelletInReserve on compressed response", () => __awaiter(void 0, void 0, void 0, function* () {
754
+ const statusData = {
755
+ commands: { power: true },
756
+ temperatures: { enviroment: 19 },
757
+ flags: { is_pellet_in_reserve: true },
758
+ pellet: { autonomy_time: 120 },
759
+ };
760
+ const mockResponseData = {
761
+ status: createGzippedBuffer(statusData),
762
+ nvm: { user_parameters: { enviroment_1_temperature: 22 } },
763
+ };
764
+ fetchStub.resolves(mockResponse(mockResponseData));
765
+ const api = configure("https://example.com/api/");
766
+ const result = yield api.getPelletInReserve(expectedToken, "mockMacAddress");
767
+ assert.equal(result, true);
768
+ }));
769
+ it("should work with getPelletAutonomyTime on response", () => __awaiter(void 0, void 0, void 0, function* () {
770
+ const mockResponseData = {
771
+ status: {
772
+ commands: { power: true },
773
+ temperatures: { enviroment: 19 },
774
+ flags: { is_pellet_in_reserve: false },
775
+ pellet: { autonomy_time: 240 },
776
+ },
777
+ nvm: { user_parameters: { enviroment_1_temperature: 22 } },
778
+ };
779
+ fetchStub.resolves(mockResponse(mockResponseData));
780
+ const api = configure("https://example.com/api/");
781
+ const result = yield api.getPelletAutonomyTime(expectedToken, "mockMacAddress");
782
+ assert.equal(result, 240);
783
+ }));
518
784
  });
519
785
  describe("Error Handling", () => {
520
786
  const errorTests = [
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edilkamin",
3
- "version": "1.8.0",
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": "^25.0.2",
73
+ "@types/node": "^24",
74
74
  "@types/pako": "^2.0.4",
75
- "@types/sinon": "^17.0.3",
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": "^19.0.2",
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/src/cli.ts CHANGED
@@ -200,6 +200,15 @@ const createProgram = (): Command => {
200
200
  mac: string,
201
201
  ) => api.getPower(jwtToken, mac),
202
202
  },
203
+ {
204
+ commandName: "getPowerLevel",
205
+ description: "Retrieve manual power level (1-5)",
206
+ getter: (
207
+ api: ReturnType<typeof configure>,
208
+ jwtToken: string,
209
+ mac: string,
210
+ ) => api.getPowerLevel(jwtToken, mac),
211
+ },
203
212
  {
204
213
  commandName: "getEnvironmentTemperature",
205
214
  description: "Retrieve environment temperature",
@@ -218,6 +227,115 @@ const createProgram = (): Command => {
218
227
  mac: string,
219
228
  ) => api.getTargetTemperature(jwtToken, mac),
220
229
  },
230
+ {
231
+ commandName: "getFan1Speed",
232
+ description: "Retrieve fan 1 speed",
233
+ getter: (
234
+ api: ReturnType<typeof configure>,
235
+ jwtToken: string,
236
+ mac: string,
237
+ ) => api.getFan1Speed(jwtToken, mac),
238
+ },
239
+ {
240
+ commandName: "getFan2Speed",
241
+ description: "Retrieve fan 2 speed",
242
+ getter: (
243
+ api: ReturnType<typeof configure>,
244
+ jwtToken: string,
245
+ mac: string,
246
+ ) => api.getFan2Speed(jwtToken, mac),
247
+ },
248
+ {
249
+ commandName: "getFan3Speed",
250
+ description: "Retrieve fan 3 speed",
251
+ getter: (
252
+ api: ReturnType<typeof configure>,
253
+ jwtToken: string,
254
+ mac: string,
255
+ ) => api.getFan3Speed(jwtToken, mac),
256
+ },
257
+ {
258
+ commandName: "getStandby",
259
+ description: "Retrieve Standby mode status",
260
+ getter: (
261
+ api: ReturnType<typeof configure>,
262
+ jwtToken: string,
263
+ mac: string,
264
+ ) => api.getStandby(jwtToken, mac),
265
+ },
266
+ {
267
+ commandName: "getStandbyTime",
268
+ description: "Retrieve standby waiting time in minutes",
269
+ getter: (
270
+ api: ReturnType<typeof configure>,
271
+ jwtToken: string,
272
+ mac: string,
273
+ ) => api.getStandbyTime(jwtToken, mac),
274
+ },
275
+ {
276
+ commandName: "getAuto",
277
+ description: "Retrieve Auto mode status",
278
+ getter: (
279
+ api: ReturnType<typeof configure>,
280
+ jwtToken: string,
281
+ mac: string,
282
+ ) => api.getAuto(jwtToken, mac),
283
+ },
284
+ {
285
+ commandName: "getEnvironment2Temperature",
286
+ description: "Retrieve Environment 2 target temperature",
287
+ getter: (
288
+ api: ReturnType<typeof configure>,
289
+ jwtToken: string,
290
+ mac: string,
291
+ ) => api.getEnvironment2Temperature(jwtToken, mac),
292
+ },
293
+ {
294
+ commandName: "getEnvironment3Temperature",
295
+ description: "Retrieve Environment 3 target temperature",
296
+ getter: (
297
+ api: ReturnType<typeof configure>,
298
+ jwtToken: string,
299
+ mac: string,
300
+ ) => api.getEnvironment3Temperature(jwtToken, mac),
301
+ },
302
+ {
303
+ commandName: "getMeasureUnit",
304
+ description: "Retrieve temperature unit (true=Fahrenheit, false=Celsius)",
305
+ getter: (
306
+ api: ReturnType<typeof configure>,
307
+ jwtToken: string,
308
+ mac: string,
309
+ ) => api.getMeasureUnit(jwtToken, mac),
310
+ },
311
+ {
312
+ commandName: "getLanguage",
313
+ description: "Retrieve display language code (0-9)",
314
+ getter: (
315
+ api: ReturnType<typeof configure>,
316
+ jwtToken: string,
317
+ mac: string,
318
+ ) => api.getLanguage(jwtToken, mac),
319
+ },
320
+ {
321
+ commandName: "getPelletInReserve",
322
+ description:
323
+ "Retrieve pellet reserve status (true=low/reserve, false=ok)",
324
+ getter: (
325
+ api: ReturnType<typeof configure>,
326
+ jwtToken: string,
327
+ mac: string,
328
+ ) => api.getPelletInReserve(jwtToken, mac),
329
+ },
330
+ {
331
+ commandName: "getPelletAutonomyTime",
332
+ description: "Retrieve estimated pellet autonomy time",
333
+ getter: (
334
+ api: ReturnType<typeof configure>,
335
+ jwtToken: string,
336
+ mac: string,
337
+ ) => api.getPelletAutonomyTime(jwtToken, mac),
338
+ },
221
339
  ].forEach(({ commandName, description, getter }) => {
222
340
  addLegacyOption(
223
341
  addMacOption(
@@ -237,6 +355,16 @@ const createProgram = (): Command => {
237
355
  value: number,
238
356
  ) => api.setPower(jwtToken, mac, value),
239
357
  },
358
+ {
359
+ commandName: "setPowerLevel",
360
+ description: "Set manual power level (1-5)",
361
+ setter: (
362
+ api: ReturnType<typeof configure>,
363
+ jwtToken: string,
364
+ mac: string,
365
+ value: number,
366
+ ) => api.setPowerLevel(jwtToken, mac, value),
367
+ },
240
368
  {
241
369
  commandName: "setTargetTemperature",
242
370
  description: "Set the target temperature (degree celsius) for a device",
@@ -247,6 +375,127 @@ const createProgram = (): Command => {
247
375
  value: number,
248
376
  ) => api.setTargetTemperature(jwtToken, mac, value),
249
377
  },
378
+ {
379
+ commandName: "setFan1Speed",
380
+ description: "Set fan 1 speed (0-5)",
381
+ setter: (
382
+ api: ReturnType<typeof configure>,
383
+ jwtToken: string,
384
+ mac: string,
385
+ value: number,
386
+ ) => api.setFan1Speed(jwtToken, mac, value),
387
+ },
388
+ {
389
+ commandName: "setFan2Speed",
390
+ description: "Set fan 2 speed (0-5)",
391
+ setter: (
392
+ api: ReturnType<typeof configure>,
393
+ jwtToken: string,
394
+ mac: string,
395
+ value: number,
396
+ ) => api.setFan2Speed(jwtToken, mac, value),
397
+ },
398
+ {
399
+ commandName: "setFan3Speed",
400
+ description: "Set fan 3 speed (0-5)",
401
+ setter: (
402
+ api: ReturnType<typeof configure>,
403
+ jwtToken: string,
404
+ mac: string,
405
+ value: number,
406
+ ) => api.setFan3Speed(jwtToken, mac, value),
407
+ },
408
+ {
409
+ commandName: "setAirkare",
410
+ description: "Enable/disable Airkare mode (1=on, 0=off)",
411
+ setter: (
412
+ api: ReturnType<typeof configure>,
413
+ jwtToken: string,
414
+ mac: string,
415
+ value: number,
416
+ ) => api.setAirkare(jwtToken, mac, value === 1),
417
+ },
418
+ {
419
+ commandName: "setRelax",
420
+ description: "Enable/disable Relax mode (1=on, 0=off)",
421
+ setter: (
422
+ api: ReturnType<typeof configure>,
423
+ jwtToken: string,
424
+ mac: string,
425
+ value: number,
426
+ ) => api.setRelax(jwtToken, mac, value === 1),
427
+ },
428
+ {
429
+ commandName: "setStandby",
430
+ description: "Enable/disable Standby mode (1=on, 0=off)",
431
+ setter: (
432
+ api: ReturnType<typeof configure>,
433
+ jwtToken: string,
434
+ mac: string,
435
+ value: number,
436
+ ) => api.setStandby(jwtToken, mac, value === 1),
437
+ },
438
+ {
439
+ commandName: "setStandbyTime",
440
+ description: "Set standby waiting time in minutes",
441
+ setter: (
442
+ api: ReturnType<typeof configure>,
443
+ jwtToken: string,
444
+ mac: string,
445
+ value: number,
446
+ ) => api.setStandbyTime(jwtToken, mac, value),
447
+ },
448
+ {
449
+ commandName: "setAuto",
450
+ description: "Enable/disable Auto mode (1=on, 0=off)",
451
+ setter: (
452
+ api: ReturnType<typeof configure>,
453
+ jwtToken: string,
454
+ mac: string,
455
+ value: number,
456
+ ) => api.setAuto(jwtToken, mac, value === 1),
457
+ },
458
+ {
459
+ commandName: "setEnvironment2Temperature",
460
+ description: "Set Environment 2 target temperature (degrees Celsius)",
461
+ setter: (
462
+ api: ReturnType<typeof configure>,
463
+ jwtToken: string,
464
+ mac: string,
465
+ value: number,
466
+ ) => api.setEnvironment2Temperature(jwtToken, mac, value),
467
+ },
468
+ {
469
+ commandName: "setEnvironment3Temperature",
470
+ description: "Set Environment 3 target temperature (degrees Celsius)",
471
+ setter: (
472
+ api: ReturnType<typeof configure>,
473
+ jwtToken: string,
474
+ mac: string,
475
+ value: number,
476
+ ) => api.setEnvironment3Temperature(jwtToken, mac, value),
477
+ },
478
+ {
479
+ commandName: "setMeasureUnit",
480
+ description: "Set temperature unit (1=Fahrenheit, 0=Celsius)",
481
+ setter: (
482
+ api: ReturnType<typeof configure>,
483
+ jwtToken: string,
484
+ mac: string,
485
+ value: number,
486
+ ) => api.setMeasureUnit(jwtToken, mac, value === 1),
487
+ },
488
+ {
489
+ commandName: "setLanguage",
490
+ description:
491
+ "Set display language (0=IT,1=FR,2=EN,3=ES,4=PT,5=DA,6=NL,7=DE,8=HU,9=PL)",
492
+ setter: (
493
+ api: ReturnType<typeof configure>,
494
+ jwtToken: string,
495
+ mac: string,
496
+ value: number,
497
+ ) => api.setLanguage(jwtToken, mac, value),
498
+ },
250
499
  ].forEach(({ commandName, description, setter }) => {
251
500
  addLegacyOption(
252
501
  addMacOption(