edilkamin 1.7.4 → 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.
Files changed (40) hide show
  1. package/.github/dependabot.yml +5 -1
  2. package/README.md +92 -4
  3. package/dist/cjs/package.json +16 -5
  4. package/dist/cjs/src/bluetooth-utils.d.ts +13 -0
  5. package/dist/cjs/src/bluetooth-utils.js +28 -0
  6. package/dist/cjs/src/bluetooth-utils.test.d.ts +1 -0
  7. package/dist/cjs/src/bluetooth-utils.test.js +35 -0
  8. package/dist/cjs/src/bluetooth.d.ts +40 -0
  9. package/dist/cjs/src/bluetooth.js +107 -0
  10. package/dist/cjs/src/cli.js +130 -0
  11. package/dist/cjs/src/index.d.ts +2 -1
  12. package/dist/cjs/src/index.js +3 -1
  13. package/dist/cjs/src/library.d.ts +26 -0
  14. package/dist/cjs/src/library.js +361 -0
  15. package/dist/cjs/src/library.test.js +266 -0
  16. package/dist/cjs/src/types.d.ts +30 -1
  17. package/dist/esm/package.json +16 -5
  18. package/dist/esm/src/bluetooth-utils.d.ts +13 -0
  19. package/dist/esm/src/bluetooth-utils.js +25 -0
  20. package/dist/esm/src/bluetooth-utils.test.d.ts +1 -0
  21. package/dist/esm/src/bluetooth-utils.test.js +33 -0
  22. package/dist/esm/src/bluetooth.d.ts +40 -0
  23. package/dist/esm/src/bluetooth.js +100 -0
  24. package/dist/esm/src/cli.js +130 -0
  25. package/dist/esm/src/index.d.ts +2 -1
  26. package/dist/esm/src/index.js +1 -0
  27. package/dist/esm/src/library.d.ts +26 -0
  28. package/dist/esm/src/library.js +361 -0
  29. package/dist/esm/src/library.test.js +266 -0
  30. package/dist/esm/src/types.d.ts +30 -1
  31. package/package.json +16 -5
  32. package/src/bluetooth-utils.test.ts +46 -0
  33. package/src/bluetooth-utils.ts +29 -0
  34. package/src/bluetooth.ts +115 -0
  35. package/src/cli.ts +249 -0
  36. package/src/index.ts +2 -0
  37. package/src/library.test.ts +372 -0
  38. package/src/library.ts +426 -0
  39. package/src/types.ts +35 -0
  40. package/tsconfig.json +1 -0
@@ -202,6 +202,207 @@ const setPowerOff = (baseURL) =>
202
202
  * console.log(response);
203
203
  */
204
204
  (jwtToken, macAddress) => setPower(baseURL)(jwtToken, macAddress, 0);
205
+ const setPowerLevel = (baseURL) =>
206
+ /**
207
+ * Sets the manual power level of the device.
208
+ *
209
+ * @param {string} jwtToken - The JWT token for authentication.
210
+ * @param {string} macAddress - The MAC address of the device.
211
+ * @param {number} level - The power level (1-5).
212
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
213
+ */
214
+ (jwtToken, macAddress, level) => mqttCommand(baseURL)(jwtToken, macAddress, {
215
+ name: "power_level",
216
+ value: level,
217
+ });
218
+ const getPowerLevel = (baseURL) =>
219
+ /**
220
+ * Retrieves the current manual power level of the device.
221
+ *
222
+ * @param {string} jwtToken - The JWT token for authentication.
223
+ * @param {string} macAddress - The MAC address of the device.
224
+ * @returns {Promise<number>} - A promise that resolves to the power level (1-5).
225
+ */
226
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
227
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
228
+ return info.nvm.user_parameters.manual_power;
229
+ });
230
+ const setFan1Speed = (baseURL) =>
231
+ /**
232
+ * Sets the speed of fan 1.
233
+ *
234
+ * @param {string} jwtToken - The JWT token for authentication.
235
+ * @param {string} macAddress - The MAC address of the device.
236
+ * @param {number} speed - The fan speed (0-5, 0=auto on some models).
237
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
238
+ */
239
+ (jwtToken, macAddress, speed) => mqttCommand(baseURL)(jwtToken, macAddress, {
240
+ name: "fan_1_speed",
241
+ value: speed,
242
+ });
243
+ const setFan2Speed = (baseURL) =>
244
+ /**
245
+ * Sets the speed of fan 2.
246
+ *
247
+ * @param {string} jwtToken - The JWT token for authentication.
248
+ * @param {string} macAddress - The MAC address of the device.
249
+ * @param {number} speed - The fan speed (0-5, 0=auto on some models).
250
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
251
+ */
252
+ (jwtToken, macAddress, speed) => mqttCommand(baseURL)(jwtToken, macAddress, {
253
+ name: "fan_2_speed",
254
+ value: speed,
255
+ });
256
+ const setFan3Speed = (baseURL) =>
257
+ /**
258
+ * Sets the speed of fan 3.
259
+ *
260
+ * @param {string} jwtToken - The JWT token for authentication.
261
+ * @param {string} macAddress - The MAC address of the device.
262
+ * @param {number} speed - The fan speed (0-5, 0=auto on some models).
263
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
264
+ */
265
+ (jwtToken, macAddress, speed) => mqttCommand(baseURL)(jwtToken, macAddress, {
266
+ name: "fan_3_speed",
267
+ value: speed,
268
+ });
269
+ const getFan1Speed = (baseURL) =>
270
+ /**
271
+ * Retrieves the current speed of fan 1.
272
+ *
273
+ * @param {string} jwtToken - The JWT token for authentication.
274
+ * @param {string} macAddress - The MAC address of the device.
275
+ * @returns {Promise<number>} - A promise that resolves to the fan speed.
276
+ */
277
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
278
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
279
+ return info.nvm.user_parameters.fan_1_ventilation;
280
+ });
281
+ const getFan2Speed = (baseURL) =>
282
+ /**
283
+ * Retrieves the current speed of fan 2.
284
+ *
285
+ * @param {string} jwtToken - The JWT token for authentication.
286
+ * @param {string} macAddress - The MAC address of the device.
287
+ * @returns {Promise<number>} - A promise that resolves to the fan speed.
288
+ */
289
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
290
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
291
+ return info.nvm.user_parameters.fan_2_ventilation;
292
+ });
293
+ const getFan3Speed = (baseURL) =>
294
+ /**
295
+ * Retrieves the current speed of fan 3.
296
+ *
297
+ * @param {string} jwtToken - The JWT token for authentication.
298
+ * @param {string} macAddress - The MAC address of the device.
299
+ * @returns {Promise<number>} - A promise that resolves to the fan speed.
300
+ */
301
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
302
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
303
+ return info.nvm.user_parameters.fan_3_ventilation;
304
+ });
305
+ const setAirkare = (baseURL) =>
306
+ /**
307
+ * Enables or disables Airkare (air quality) mode.
308
+ *
309
+ * @param {string} jwtToken - The JWT token for authentication.
310
+ * @param {string} macAddress - The MAC address of the device.
311
+ * @param {boolean} enabled - Whether to enable Airkare mode.
312
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
313
+ */
314
+ (jwtToken, macAddress, enabled) => mqttCommand(baseURL)(jwtToken, macAddress, {
315
+ name: "airkare_function",
316
+ value: enabled ? 1 : 0,
317
+ });
318
+ const setRelax = (baseURL) =>
319
+ /**
320
+ * Enables or disables Relax (comfort) mode.
321
+ *
322
+ * @param {string} jwtToken - The JWT token for authentication.
323
+ * @param {string} macAddress - The MAC address of the device.
324
+ * @param {boolean} enabled - Whether to enable Relax mode.
325
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
326
+ */
327
+ (jwtToken, macAddress, enabled) => mqttCommand(baseURL)(jwtToken, macAddress, {
328
+ name: "relax_mode",
329
+ value: enabled,
330
+ });
331
+ const setStandby = (baseURL) =>
332
+ /**
333
+ * Enables or disables Standby mode.
334
+ *
335
+ * @param {string} jwtToken - The JWT token for authentication.
336
+ * @param {string} macAddress - The MAC address of the device.
337
+ * @param {boolean} enabled - Whether to enable Standby mode.
338
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
339
+ */
340
+ (jwtToken, macAddress, enabled) => mqttCommand(baseURL)(jwtToken, macAddress, {
341
+ name: "standby_mode",
342
+ value: enabled,
343
+ });
344
+ const getStandby = (baseURL) =>
345
+ /**
346
+ * Retrieves the current Standby mode status.
347
+ *
348
+ * @param {string} jwtToken - The JWT token for authentication.
349
+ * @param {string} macAddress - The MAC address of the device.
350
+ * @returns {Promise<boolean>} - A promise that resolves to the standby status.
351
+ */
352
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
353
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
354
+ return info.nvm.user_parameters.is_standby_active;
355
+ });
356
+ const setStandbyTime = (baseURL) =>
357
+ /**
358
+ * Sets the standby waiting time in minutes.
359
+ *
360
+ * @param {string} jwtToken - The JWT token for authentication.
361
+ * @param {string} macAddress - The MAC address of the device.
362
+ * @param {number} minutes - The standby waiting time in minutes.
363
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
364
+ */
365
+ (jwtToken, macAddress, minutes) => mqttCommand(baseURL)(jwtToken, macAddress, {
366
+ name: "standby_time",
367
+ value: minutes,
368
+ });
369
+ const getStandbyTime = (baseURL) =>
370
+ /**
371
+ * Retrieves the standby waiting time in minutes.
372
+ *
373
+ * @param {string} jwtToken - The JWT token for authentication.
374
+ * @param {string} macAddress - The MAC address of the device.
375
+ * @returns {Promise<number>} - A promise that resolves to the standby time in minutes.
376
+ */
377
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
378
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
379
+ return info.nvm.user_parameters.standby_waiting_time;
380
+ });
381
+ const setAuto = (baseURL) =>
382
+ /**
383
+ * Enables or disables Auto mode for automatic temperature regulation.
384
+ *
385
+ * @param {string} jwtToken - The JWT token for authentication.
386
+ * @param {string} macAddress - The MAC address of the device.
387
+ * @param {boolean} enabled - Whether to enable Auto mode.
388
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
389
+ */
390
+ (jwtToken, macAddress, enabled) => mqttCommand(baseURL)(jwtToken, macAddress, {
391
+ name: "auto_mode",
392
+ value: enabled,
393
+ });
394
+ const getAuto = (baseURL) =>
395
+ /**
396
+ * Retrieves the current Auto mode status.
397
+ *
398
+ * @param {string} jwtToken - The JWT token for authentication.
399
+ * @param {string} macAddress - The MAC address of the device.
400
+ * @returns {Promise<boolean>} - A promise that resolves to the auto mode status.
401
+ */
402
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
403
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
404
+ return info.nvm.user_parameters.is_auto;
405
+ });
205
406
  const getPower = (baseURL) =>
206
407
  /**
207
408
  * Retrieves the power status of the device.
@@ -251,6 +452,140 @@ const setTargetTemperature = (baseURL) =>
251
452
  name: "enviroment_1_temperature",
252
453
  value: temperature,
253
454
  });
455
+ const setEnvironment2Temperature = (baseURL) =>
456
+ /**
457
+ * Sets the target temperature for Environment 2 zone.
458
+ *
459
+ * @param {string} jwtToken - The JWT token for authentication.
460
+ * @param {string} macAddress - The MAC address of the device.
461
+ * @param {number} temperature - The target temperature in degrees Celsius.
462
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
463
+ */
464
+ (jwtToken, macAddress, temperature) => mqttCommand(baseURL)(jwtToken, macAddress, {
465
+ name: "enviroment_2_temperature",
466
+ value: temperature,
467
+ });
468
+ const getEnvironment2Temperature = (baseURL) =>
469
+ /**
470
+ * Retrieves the target temperature for Environment 2 zone.
471
+ *
472
+ * @param {string} jwtToken - The JWT token for authentication.
473
+ * @param {string} macAddress - The MAC address of the device.
474
+ * @returns {Promise<number>} - A promise that resolves to the temperature in degrees Celsius.
475
+ */
476
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
477
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
478
+ return info.nvm.user_parameters.enviroment_2_temperature;
479
+ });
480
+ const setEnvironment3Temperature = (baseURL) =>
481
+ /**
482
+ * Sets the target temperature for Environment 3 zone.
483
+ *
484
+ * @param {string} jwtToken - The JWT token for authentication.
485
+ * @param {string} macAddress - The MAC address of the device.
486
+ * @param {number} temperature - The target temperature in degrees Celsius.
487
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
488
+ */
489
+ (jwtToken, macAddress, temperature) => mqttCommand(baseURL)(jwtToken, macAddress, {
490
+ name: "enviroment_3_temperature",
491
+ value: temperature,
492
+ });
493
+ const getEnvironment3Temperature = (baseURL) =>
494
+ /**
495
+ * Retrieves the target temperature for Environment 3 zone.
496
+ *
497
+ * @param {string} jwtToken - The JWT token for authentication.
498
+ * @param {string} macAddress - The MAC address of the device.
499
+ * @returns {Promise<number>} - A promise that resolves to the temperature in degrees Celsius.
500
+ */
501
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
502
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
503
+ return info.nvm.user_parameters.enviroment_3_temperature;
504
+ });
505
+ const setMeasureUnit = (baseURL) =>
506
+ /**
507
+ * Sets the temperature measurement unit (Celsius or Fahrenheit).
508
+ *
509
+ * @param {string} jwtToken - The JWT token for authentication.
510
+ * @param {string} macAddress - The MAC address of the device.
511
+ * @param {boolean} isFahrenheit - true for Fahrenheit, false for Celsius.
512
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
513
+ */
514
+ (jwtToken, macAddress, isFahrenheit) => mqttCommand(baseURL)(jwtToken, macAddress, {
515
+ name: "measure_unit",
516
+ value: isFahrenheit,
517
+ });
518
+ const getMeasureUnit = (baseURL) =>
519
+ /**
520
+ * Retrieves the current temperature measurement unit setting.
521
+ *
522
+ * @param {string} jwtToken - The JWT token for authentication.
523
+ * @param {string} macAddress - The MAC address of the device.
524
+ * @returns {Promise<boolean>} - A promise that resolves to true if Fahrenheit, false if Celsius.
525
+ */
526
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
527
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
528
+ return info.nvm.user_parameters.is_fahrenheit;
529
+ });
530
+ const setLanguage = (baseURL) =>
531
+ /**
532
+ * Sets the display language of the device.
533
+ *
534
+ * Language codes:
535
+ * 0=Italian, 1=French, 2=English, 3=Spanish, 4=Portuguese,
536
+ * 5=Danish, 6=Dutch, 7=German, 8=Hungarian, 9=Polish
537
+ *
538
+ * @param {string} jwtToken - The JWT token for authentication.
539
+ * @param {string} macAddress - The MAC address of the device.
540
+ * @param {number} languageCode - The language code (0-9).
541
+ * @returns {Promise<unknown>} - A promise that resolves to the command response.
542
+ */
543
+ (jwtToken, macAddress, languageCode) => mqttCommand(baseURL)(jwtToken, macAddress, {
544
+ name: "language",
545
+ value: languageCode,
546
+ });
547
+ const getLanguage = (baseURL) =>
548
+ /**
549
+ * Retrieves the current display language setting.
550
+ *
551
+ * Language codes:
552
+ * 0=Italian, 1=French, 2=English, 3=Spanish, 4=Portuguese,
553
+ * 5=Danish, 6=Dutch, 7=German, 8=Hungarian, 9=Polish
554
+ *
555
+ * @param {string} jwtToken - The JWT token for authentication.
556
+ * @param {string} macAddress - The MAC address of the device.
557
+ * @returns {Promise<number>} - A promise that resolves to the language code (0-9).
558
+ */
559
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
560
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
561
+ return info.nvm.user_parameters.language;
562
+ });
563
+ const getPelletInReserve = (baseURL) =>
564
+ /**
565
+ * Retrieves the pellet reserve status.
566
+ * Returns true if pellet level is low (in reserve), false if pellet level is ok.
567
+ *
568
+ * @param {string} jwtToken - The JWT token for authentication.
569
+ * @param {string} macAddress - The MAC address of the device.
570
+ * @returns {Promise<boolean>} - A promise that resolves to the pellet reserve status.
571
+ */
572
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
573
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
574
+ return info.status.flags.is_pellet_in_reserve;
575
+ });
576
+ const getPelletAutonomyTime = (baseURL) =>
577
+ /**
578
+ * Retrieves the estimated pellet autonomy time.
579
+ * Represents the estimated time remaining with current pellet level.
580
+ *
581
+ * @param {string} jwtToken - The JWT token for authentication.
582
+ * @param {string} macAddress - The MAC address of the device.
583
+ * @returns {Promise<number>} - A promise that resolves to the autonomy time (likely in minutes or hours).
584
+ */
585
+ (jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
586
+ const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
587
+ return info.status.pellet.autonomy_time;
588
+ });
254
589
  const registerDevice = (baseURL) =>
255
590
  /**
256
591
  * Registers a device with the user's account.
@@ -317,8 +652,34 @@ const configure = (baseURL = constants_1.API_URL) => ({
317
652
  setPowerOff: setPowerOff(baseURL),
318
653
  setPowerOn: setPowerOn(baseURL),
319
654
  getPower: getPower(baseURL),
655
+ setPowerLevel: setPowerLevel(baseURL),
656
+ getPowerLevel: getPowerLevel(baseURL),
657
+ setFan1Speed: setFan1Speed(baseURL),
658
+ setFan2Speed: setFan2Speed(baseURL),
659
+ setFan3Speed: setFan3Speed(baseURL),
660
+ getFan1Speed: getFan1Speed(baseURL),
661
+ getFan2Speed: getFan2Speed(baseURL),
662
+ getFan3Speed: getFan3Speed(baseURL),
663
+ setAirkare: setAirkare(baseURL),
664
+ setRelax: setRelax(baseURL),
665
+ setStandby: setStandby(baseURL),
666
+ getStandby: getStandby(baseURL),
667
+ setStandbyTime: setStandbyTime(baseURL),
668
+ getStandbyTime: getStandbyTime(baseURL),
669
+ setAuto: setAuto(baseURL),
670
+ getAuto: getAuto(baseURL),
320
671
  getEnvironmentTemperature: getEnvironmentTemperature(baseURL),
321
672
  getTargetTemperature: getTargetTemperature(baseURL),
322
673
  setTargetTemperature: setTargetTemperature(baseURL),
674
+ setEnvironment2Temperature: setEnvironment2Temperature(baseURL),
675
+ getEnvironment2Temperature: getEnvironment2Temperature(baseURL),
676
+ setEnvironment3Temperature: setEnvironment3Temperature(baseURL),
677
+ getEnvironment3Temperature: getEnvironment3Temperature(baseURL),
678
+ setMeasureUnit: setMeasureUnit(baseURL),
679
+ getMeasureUnit: getMeasureUnit(baseURL),
680
+ setLanguage: setLanguage(baseURL),
681
+ getLanguage: getLanguage(baseURL),
682
+ getPelletInReserve: getPelletInReserve(baseURL),
683
+ getPelletAutonomyTime: getPelletAutonomyTime(baseURL),
323
684
  });
324
685
  exports.configure = configure;