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.
- package/.github/dependabot.yml +5 -1
- package/README.md +92 -4
- package/dist/cjs/package.json +16 -5
- package/dist/cjs/src/bluetooth-utils.d.ts +13 -0
- package/dist/cjs/src/bluetooth-utils.js +28 -0
- package/dist/cjs/src/bluetooth-utils.test.d.ts +1 -0
- package/dist/cjs/src/bluetooth-utils.test.js +35 -0
- package/dist/cjs/src/bluetooth.d.ts +40 -0
- package/dist/cjs/src/bluetooth.js +107 -0
- package/dist/cjs/src/cli.js +130 -0
- package/dist/cjs/src/index.d.ts +2 -1
- package/dist/cjs/src/index.js +3 -1
- 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 +30 -1
- package/dist/esm/package.json +16 -5
- package/dist/esm/src/bluetooth-utils.d.ts +13 -0
- package/dist/esm/src/bluetooth-utils.js +25 -0
- package/dist/esm/src/bluetooth-utils.test.d.ts +1 -0
- package/dist/esm/src/bluetooth-utils.test.js +33 -0
- package/dist/esm/src/bluetooth.d.ts +40 -0
- package/dist/esm/src/bluetooth.js +100 -0
- package/dist/esm/src/cli.js +130 -0
- package/dist/esm/src/index.d.ts +2 -1
- package/dist/esm/src/index.js +1 -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 +30 -1
- package/package.json +16 -5
- package/src/bluetooth-utils.test.ts +46 -0
- package/src/bluetooth-utils.ts +29 -0
- package/src/bluetooth.ts +115 -0
- package/src/cli.ts +249 -0
- package/src/index.ts +2 -0
- package/src/library.test.ts +372 -0
- package/src/library.ts +426 -0
- package/src/types.ts +35 -0
- package/tsconfig.json +1 -0
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
|
});
|
package/dist/esm/src/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
export { bleToWifiMac } from "./bluetooth-utils";
|
|
1
2
|
export { decompressBuffer, isBuffer, processResponse } from "./buffer-utils";
|
|
2
3
|
export { API_URL, NEW_API_URL, OLD_API_URL } from "./constants";
|
|
3
4
|
export { configure, getSession, signIn } from "./library";
|
|
4
5
|
export { serialNumberDisplay, serialNumberFromHex, serialNumberToHex, } from "./serial-utils";
|
|
5
|
-
export { BufferEncodedType, CommandsType, DeviceAssociationBody, DeviceAssociationResponse, DeviceInfoRawType, DeviceInfoType, EditDeviceAssociationBody, StatusType, TemperaturesType, UserParametersType, } from "./types";
|
|
6
|
+
export { BufferEncodedType, CommandsType, DeviceAssociationBody, DeviceAssociationResponse, DeviceInfoRawType, DeviceInfoType, DiscoveredDevice, EditDeviceAssociationBody, StatusType, TemperaturesType, UserParametersType, } from "./types";
|
|
6
7
|
export declare const deviceInfo: (jwtToken: string, macAddress: string) => Promise<import("./types").DeviceInfoType>, registerDevice: (jwtToken: string, macAddress: string, serialNumber: string, deviceName?: string, deviceRoom?: string) => Promise<import("./types").DeviceAssociationResponse>, editDevice: (jwtToken: string, macAddress: string, deviceName?: string, deviceRoom?: string) => Promise<import("./types").DeviceAssociationResponse>, setPower: (jwtToken: string, macAddress: string, value: number) => Promise<unknown>, setPowerOff: (jwtToken: string, macAddress: string) => Promise<unknown>, setPowerOn: (jwtToken: string, macAddress: string) => Promise<unknown>, getPower: (jwtToken: string, macAddress: string) => Promise<boolean>, getEnvironmentTemperature: (jwtToken: string, macAddress: string) => Promise<number>, getTargetTemperature: (jwtToken: string, macAddress: string) => Promise<number>, setTargetTemperature: (jwtToken: string, macAddress: string, temperature: number) => Promise<unknown>;
|
package/dist/esm/src/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { configure } from "./library";
|
|
2
|
+
export { bleToWifiMac } from "./bluetooth-utils";
|
|
2
3
|
export { decompressBuffer, isBuffer, processResponse } from "./buffer-utils";
|
|
3
4
|
export { API_URL, NEW_API_URL, OLD_API_URL } from "./constants";
|
|
4
5
|
export { configure, getSession, signIn } from "./library";
|
|
@@ -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, };
|
package/dist/esm/src/library.js
CHANGED
|
@@ -161,6 +161,207 @@ const setPowerOff = (baseURL) =>
|
|
|
161
161
|
* console.log(response);
|
|
162
162
|
*/
|
|
163
163
|
(jwtToken, macAddress) => setPower(baseURL)(jwtToken, macAddress, 0);
|
|
164
|
+
const setPowerLevel = (baseURL) =>
|
|
165
|
+
/**
|
|
166
|
+
* Sets the manual power level of the device.
|
|
167
|
+
*
|
|
168
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
169
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
170
|
+
* @param {number} level - The power level (1-5).
|
|
171
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
172
|
+
*/
|
|
173
|
+
(jwtToken, macAddress, level) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
174
|
+
name: "power_level",
|
|
175
|
+
value: level,
|
|
176
|
+
});
|
|
177
|
+
const getPowerLevel = (baseURL) =>
|
|
178
|
+
/**
|
|
179
|
+
* Retrieves the current manual power level of the device.
|
|
180
|
+
*
|
|
181
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
182
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
183
|
+
* @returns {Promise<number>} - A promise that resolves to the power level (1-5).
|
|
184
|
+
*/
|
|
185
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
186
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
187
|
+
return info.nvm.user_parameters.manual_power;
|
|
188
|
+
});
|
|
189
|
+
const setFan1Speed = (baseURL) =>
|
|
190
|
+
/**
|
|
191
|
+
* Sets the speed of fan 1.
|
|
192
|
+
*
|
|
193
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
194
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
195
|
+
* @param {number} speed - The fan speed (0-5, 0=auto on some models).
|
|
196
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
197
|
+
*/
|
|
198
|
+
(jwtToken, macAddress, speed) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
199
|
+
name: "fan_1_speed",
|
|
200
|
+
value: speed,
|
|
201
|
+
});
|
|
202
|
+
const setFan2Speed = (baseURL) =>
|
|
203
|
+
/**
|
|
204
|
+
* Sets the speed of fan 2.
|
|
205
|
+
*
|
|
206
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
207
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
208
|
+
* @param {number} speed - The fan speed (0-5, 0=auto on some models).
|
|
209
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
210
|
+
*/
|
|
211
|
+
(jwtToken, macAddress, speed) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
212
|
+
name: "fan_2_speed",
|
|
213
|
+
value: speed,
|
|
214
|
+
});
|
|
215
|
+
const setFan3Speed = (baseURL) =>
|
|
216
|
+
/**
|
|
217
|
+
* Sets the speed of fan 3.
|
|
218
|
+
*
|
|
219
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
220
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
221
|
+
* @param {number} speed - The fan speed (0-5, 0=auto on some models).
|
|
222
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
223
|
+
*/
|
|
224
|
+
(jwtToken, macAddress, speed) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
225
|
+
name: "fan_3_speed",
|
|
226
|
+
value: speed,
|
|
227
|
+
});
|
|
228
|
+
const getFan1Speed = (baseURL) =>
|
|
229
|
+
/**
|
|
230
|
+
* Retrieves the current speed of fan 1.
|
|
231
|
+
*
|
|
232
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
233
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
234
|
+
* @returns {Promise<number>} - A promise that resolves to the fan speed.
|
|
235
|
+
*/
|
|
236
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
237
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
238
|
+
return info.nvm.user_parameters.fan_1_ventilation;
|
|
239
|
+
});
|
|
240
|
+
const getFan2Speed = (baseURL) =>
|
|
241
|
+
/**
|
|
242
|
+
* Retrieves the current speed of fan 2.
|
|
243
|
+
*
|
|
244
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
245
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
246
|
+
* @returns {Promise<number>} - A promise that resolves to the fan speed.
|
|
247
|
+
*/
|
|
248
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
249
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
250
|
+
return info.nvm.user_parameters.fan_2_ventilation;
|
|
251
|
+
});
|
|
252
|
+
const getFan3Speed = (baseURL) =>
|
|
253
|
+
/**
|
|
254
|
+
* Retrieves the current speed of fan 3.
|
|
255
|
+
*
|
|
256
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
257
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
258
|
+
* @returns {Promise<number>} - A promise that resolves to the fan speed.
|
|
259
|
+
*/
|
|
260
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
261
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
262
|
+
return info.nvm.user_parameters.fan_3_ventilation;
|
|
263
|
+
});
|
|
264
|
+
const setAirkare = (baseURL) =>
|
|
265
|
+
/**
|
|
266
|
+
* Enables or disables Airkare (air quality) mode.
|
|
267
|
+
*
|
|
268
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
269
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
270
|
+
* @param {boolean} enabled - Whether to enable Airkare mode.
|
|
271
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
272
|
+
*/
|
|
273
|
+
(jwtToken, macAddress, enabled) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
274
|
+
name: "airkare_function",
|
|
275
|
+
value: enabled ? 1 : 0,
|
|
276
|
+
});
|
|
277
|
+
const setRelax = (baseURL) =>
|
|
278
|
+
/**
|
|
279
|
+
* Enables or disables Relax (comfort) mode.
|
|
280
|
+
*
|
|
281
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
282
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
283
|
+
* @param {boolean} enabled - Whether to enable Relax mode.
|
|
284
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
285
|
+
*/
|
|
286
|
+
(jwtToken, macAddress, enabled) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
287
|
+
name: "relax_mode",
|
|
288
|
+
value: enabled,
|
|
289
|
+
});
|
|
290
|
+
const setStandby = (baseURL) =>
|
|
291
|
+
/**
|
|
292
|
+
* Enables or disables Standby mode.
|
|
293
|
+
*
|
|
294
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
295
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
296
|
+
* @param {boolean} enabled - Whether to enable Standby mode.
|
|
297
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
298
|
+
*/
|
|
299
|
+
(jwtToken, macAddress, enabled) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
300
|
+
name: "standby_mode",
|
|
301
|
+
value: enabled,
|
|
302
|
+
});
|
|
303
|
+
const getStandby = (baseURL) =>
|
|
304
|
+
/**
|
|
305
|
+
* Retrieves the current Standby mode status.
|
|
306
|
+
*
|
|
307
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
308
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
309
|
+
* @returns {Promise<boolean>} - A promise that resolves to the standby status.
|
|
310
|
+
*/
|
|
311
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
312
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
313
|
+
return info.nvm.user_parameters.is_standby_active;
|
|
314
|
+
});
|
|
315
|
+
const setStandbyTime = (baseURL) =>
|
|
316
|
+
/**
|
|
317
|
+
* Sets the standby waiting time in minutes.
|
|
318
|
+
*
|
|
319
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
320
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
321
|
+
* @param {number} minutes - The standby waiting time in minutes.
|
|
322
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
323
|
+
*/
|
|
324
|
+
(jwtToken, macAddress, minutes) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
325
|
+
name: "standby_time",
|
|
326
|
+
value: minutes,
|
|
327
|
+
});
|
|
328
|
+
const getStandbyTime = (baseURL) =>
|
|
329
|
+
/**
|
|
330
|
+
* Retrieves the standby waiting time in minutes.
|
|
331
|
+
*
|
|
332
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
333
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
334
|
+
* @returns {Promise<number>} - A promise that resolves to the standby time in minutes.
|
|
335
|
+
*/
|
|
336
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
337
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
338
|
+
return info.nvm.user_parameters.standby_waiting_time;
|
|
339
|
+
});
|
|
340
|
+
const setAuto = (baseURL) =>
|
|
341
|
+
/**
|
|
342
|
+
* Enables or disables Auto mode for automatic temperature regulation.
|
|
343
|
+
*
|
|
344
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
345
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
346
|
+
* @param {boolean} enabled - Whether to enable Auto mode.
|
|
347
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
348
|
+
*/
|
|
349
|
+
(jwtToken, macAddress, enabled) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
350
|
+
name: "auto_mode",
|
|
351
|
+
value: enabled,
|
|
352
|
+
});
|
|
353
|
+
const getAuto = (baseURL) =>
|
|
354
|
+
/**
|
|
355
|
+
* Retrieves the current Auto mode status.
|
|
356
|
+
*
|
|
357
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
358
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
359
|
+
* @returns {Promise<boolean>} - A promise that resolves to the auto mode status.
|
|
360
|
+
*/
|
|
361
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
362
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
363
|
+
return info.nvm.user_parameters.is_auto;
|
|
364
|
+
});
|
|
164
365
|
const getPower = (baseURL) =>
|
|
165
366
|
/**
|
|
166
367
|
* Retrieves the power status of the device.
|
|
@@ -210,6 +411,140 @@ const setTargetTemperature = (baseURL) =>
|
|
|
210
411
|
name: "enviroment_1_temperature",
|
|
211
412
|
value: temperature,
|
|
212
413
|
});
|
|
414
|
+
const setEnvironment2Temperature = (baseURL) =>
|
|
415
|
+
/**
|
|
416
|
+
* Sets the target temperature for Environment 2 zone.
|
|
417
|
+
*
|
|
418
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
419
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
420
|
+
* @param {number} temperature - The target temperature in degrees Celsius.
|
|
421
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
422
|
+
*/
|
|
423
|
+
(jwtToken, macAddress, temperature) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
424
|
+
name: "enviroment_2_temperature",
|
|
425
|
+
value: temperature,
|
|
426
|
+
});
|
|
427
|
+
const getEnvironment2Temperature = (baseURL) =>
|
|
428
|
+
/**
|
|
429
|
+
* Retrieves the target temperature for Environment 2 zone.
|
|
430
|
+
*
|
|
431
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
432
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
433
|
+
* @returns {Promise<number>} - A promise that resolves to the temperature in degrees Celsius.
|
|
434
|
+
*/
|
|
435
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
436
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
437
|
+
return info.nvm.user_parameters.enviroment_2_temperature;
|
|
438
|
+
});
|
|
439
|
+
const setEnvironment3Temperature = (baseURL) =>
|
|
440
|
+
/**
|
|
441
|
+
* Sets the target temperature for Environment 3 zone.
|
|
442
|
+
*
|
|
443
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
444
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
445
|
+
* @param {number} temperature - The target temperature in degrees Celsius.
|
|
446
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
447
|
+
*/
|
|
448
|
+
(jwtToken, macAddress, temperature) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
449
|
+
name: "enviroment_3_temperature",
|
|
450
|
+
value: temperature,
|
|
451
|
+
});
|
|
452
|
+
const getEnvironment3Temperature = (baseURL) =>
|
|
453
|
+
/**
|
|
454
|
+
* Retrieves the target temperature for Environment 3 zone.
|
|
455
|
+
*
|
|
456
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
457
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
458
|
+
* @returns {Promise<number>} - A promise that resolves to the temperature in degrees Celsius.
|
|
459
|
+
*/
|
|
460
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
461
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
462
|
+
return info.nvm.user_parameters.enviroment_3_temperature;
|
|
463
|
+
});
|
|
464
|
+
const setMeasureUnit = (baseURL) =>
|
|
465
|
+
/**
|
|
466
|
+
* Sets the temperature measurement unit (Celsius or Fahrenheit).
|
|
467
|
+
*
|
|
468
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
469
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
470
|
+
* @param {boolean} isFahrenheit - true for Fahrenheit, false for Celsius.
|
|
471
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
472
|
+
*/
|
|
473
|
+
(jwtToken, macAddress, isFahrenheit) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
474
|
+
name: "measure_unit",
|
|
475
|
+
value: isFahrenheit,
|
|
476
|
+
});
|
|
477
|
+
const getMeasureUnit = (baseURL) =>
|
|
478
|
+
/**
|
|
479
|
+
* Retrieves the current temperature measurement unit setting.
|
|
480
|
+
*
|
|
481
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
482
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
483
|
+
* @returns {Promise<boolean>} - A promise that resolves to true if Fahrenheit, false if Celsius.
|
|
484
|
+
*/
|
|
485
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
486
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
487
|
+
return info.nvm.user_parameters.is_fahrenheit;
|
|
488
|
+
});
|
|
489
|
+
const setLanguage = (baseURL) =>
|
|
490
|
+
/**
|
|
491
|
+
* Sets the display language of the device.
|
|
492
|
+
*
|
|
493
|
+
* Language codes:
|
|
494
|
+
* 0=Italian, 1=French, 2=English, 3=Spanish, 4=Portuguese,
|
|
495
|
+
* 5=Danish, 6=Dutch, 7=German, 8=Hungarian, 9=Polish
|
|
496
|
+
*
|
|
497
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
498
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
499
|
+
* @param {number} languageCode - The language code (0-9).
|
|
500
|
+
* @returns {Promise<unknown>} - A promise that resolves to the command response.
|
|
501
|
+
*/
|
|
502
|
+
(jwtToken, macAddress, languageCode) => mqttCommand(baseURL)(jwtToken, macAddress, {
|
|
503
|
+
name: "language",
|
|
504
|
+
value: languageCode,
|
|
505
|
+
});
|
|
506
|
+
const getLanguage = (baseURL) =>
|
|
507
|
+
/**
|
|
508
|
+
* Retrieves the current display language setting.
|
|
509
|
+
*
|
|
510
|
+
* Language codes:
|
|
511
|
+
* 0=Italian, 1=French, 2=English, 3=Spanish, 4=Portuguese,
|
|
512
|
+
* 5=Danish, 6=Dutch, 7=German, 8=Hungarian, 9=Polish
|
|
513
|
+
*
|
|
514
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
515
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
516
|
+
* @returns {Promise<number>} - A promise that resolves to the language code (0-9).
|
|
517
|
+
*/
|
|
518
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
519
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
520
|
+
return info.nvm.user_parameters.language;
|
|
521
|
+
});
|
|
522
|
+
const getPelletInReserve = (baseURL) =>
|
|
523
|
+
/**
|
|
524
|
+
* Retrieves the pellet reserve status.
|
|
525
|
+
* Returns true if pellet level is low (in reserve), false if pellet level is ok.
|
|
526
|
+
*
|
|
527
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
528
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
529
|
+
* @returns {Promise<boolean>} - A promise that resolves to the pellet reserve status.
|
|
530
|
+
*/
|
|
531
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
532
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
533
|
+
return info.status.flags.is_pellet_in_reserve;
|
|
534
|
+
});
|
|
535
|
+
const getPelletAutonomyTime = (baseURL) =>
|
|
536
|
+
/**
|
|
537
|
+
* Retrieves the estimated pellet autonomy time.
|
|
538
|
+
* Represents the estimated time remaining with current pellet level.
|
|
539
|
+
*
|
|
540
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
541
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
542
|
+
* @returns {Promise<number>} - A promise that resolves to the autonomy time (likely in minutes or hours).
|
|
543
|
+
*/
|
|
544
|
+
(jwtToken, macAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
545
|
+
const info = yield deviceInfo(baseURL)(jwtToken, macAddress);
|
|
546
|
+
return info.status.pellet.autonomy_time;
|
|
547
|
+
});
|
|
213
548
|
const registerDevice = (baseURL) =>
|
|
214
549
|
/**
|
|
215
550
|
* Registers a device with the user's account.
|
|
@@ -276,8 +611,34 @@ const configure = (baseURL = API_URL) => ({
|
|
|
276
611
|
setPowerOff: setPowerOff(baseURL),
|
|
277
612
|
setPowerOn: setPowerOn(baseURL),
|
|
278
613
|
getPower: getPower(baseURL),
|
|
614
|
+
setPowerLevel: setPowerLevel(baseURL),
|
|
615
|
+
getPowerLevel: getPowerLevel(baseURL),
|
|
616
|
+
setFan1Speed: setFan1Speed(baseURL),
|
|
617
|
+
setFan2Speed: setFan2Speed(baseURL),
|
|
618
|
+
setFan3Speed: setFan3Speed(baseURL),
|
|
619
|
+
getFan1Speed: getFan1Speed(baseURL),
|
|
620
|
+
getFan2Speed: getFan2Speed(baseURL),
|
|
621
|
+
getFan3Speed: getFan3Speed(baseURL),
|
|
622
|
+
setAirkare: setAirkare(baseURL),
|
|
623
|
+
setRelax: setRelax(baseURL),
|
|
624
|
+
setStandby: setStandby(baseURL),
|
|
625
|
+
getStandby: getStandby(baseURL),
|
|
626
|
+
setStandbyTime: setStandbyTime(baseURL),
|
|
627
|
+
getStandbyTime: getStandbyTime(baseURL),
|
|
628
|
+
setAuto: setAuto(baseURL),
|
|
629
|
+
getAuto: getAuto(baseURL),
|
|
279
630
|
getEnvironmentTemperature: getEnvironmentTemperature(baseURL),
|
|
280
631
|
getTargetTemperature: getTargetTemperature(baseURL),
|
|
281
632
|
setTargetTemperature: setTargetTemperature(baseURL),
|
|
633
|
+
setEnvironment2Temperature: setEnvironment2Temperature(baseURL),
|
|
634
|
+
getEnvironment2Temperature: getEnvironment2Temperature(baseURL),
|
|
635
|
+
setEnvironment3Temperature: setEnvironment3Temperature(baseURL),
|
|
636
|
+
getEnvironment3Temperature: getEnvironment3Temperature(baseURL),
|
|
637
|
+
setMeasureUnit: setMeasureUnit(baseURL),
|
|
638
|
+
getMeasureUnit: getMeasureUnit(baseURL),
|
|
639
|
+
setLanguage: setLanguage(baseURL),
|
|
640
|
+
getLanguage: getLanguage(baseURL),
|
|
641
|
+
getPelletInReserve: getPelletInReserve(baseURL),
|
|
642
|
+
getPelletAutonomyTime: getPelletAutonomyTime(baseURL),
|
|
282
643
|
});
|
|
283
644
|
export { configure, configureAmplify, createAuthService, getSession, headers, signIn, };
|