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
package/.github/dependabot.yml
CHANGED
|
@@ -11,7 +11,11 @@ updates:
|
|
|
11
11
|
open-pull-requests-limit: 5
|
|
12
12
|
commit-message:
|
|
13
13
|
prefix: ":arrow_up:"
|
|
14
|
-
|
|
14
|
+
# Ignore non-LTS Node.js versions for @types/node
|
|
15
|
+
# Update this when bumping to the next LTS (e.g., 26.x -> ignore 27.x)
|
|
16
|
+
ignore:
|
|
17
|
+
- dependency-name: "@types/node"
|
|
18
|
+
versions: ["25.x"]
|
|
15
19
|
# GitHub Actions dependencies
|
|
16
20
|
- package-ecosystem: "github-actions"
|
|
17
21
|
directory: "/"
|
package/README.md
CHANGED
|
@@ -154,6 +154,57 @@ const wifiMac = bleToWifiMac(bleMac); // "a8032afed508"
|
|
|
154
154
|
to the [proprietary mobile app](https://play.google.com/store/apps/details?id=com.edilkamin.stufe)
|
|
155
155
|
- improving the interoperability (Nest, HomeAssistant...)
|
|
156
156
|
|
|
157
|
+
## Device Control Methods
|
|
158
|
+
|
|
159
|
+
The library provides comprehensive control over Edilkamin stoves:
|
|
160
|
+
|
|
161
|
+
### Power Control
|
|
162
|
+
|
|
163
|
+
```js
|
|
164
|
+
setPowerOn(token, mac); // Turn on
|
|
165
|
+
setPowerOff(token, mac); // Turn off
|
|
166
|
+
setPower(token, mac, 1); // 1=on, 0=off
|
|
167
|
+
getPower(token, mac); // Returns boolean
|
|
168
|
+
setPowerLevel(token, mac, 3); // Set power level (1-5)
|
|
169
|
+
getPowerLevel(token, mac); // Returns 1-5
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Fan Speed
|
|
173
|
+
|
|
174
|
+
```js
|
|
175
|
+
setFan1Speed(token, mac, 3); // Set fan 1 speed (0-5)
|
|
176
|
+
setFan2Speed(token, mac, 3); // Set fan 2 speed (0-5)
|
|
177
|
+
setFan3Speed(token, mac, 3); // Set fan 3 speed (0-5)
|
|
178
|
+
getFan1Speed(token, mac); // Get fan 1 speed
|
|
179
|
+
getFan2Speed(token, mac); // Get fan 2 speed
|
|
180
|
+
getFan3Speed(token, mac); // Get fan 3 speed
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Operating Modes
|
|
184
|
+
|
|
185
|
+
```js
|
|
186
|
+
setAirkare(token, mac, true); // Enable/disable air quality mode
|
|
187
|
+
setRelax(token, mac, true); // Enable/disable comfort mode
|
|
188
|
+
setStandby(token, mac, true); // Enable/disable standby mode
|
|
189
|
+
getStandby(token, mac); // Get standby status
|
|
190
|
+
setStandbyTime(token, mac, 30); // Set standby timer (minutes)
|
|
191
|
+
getStandbyTime(token, mac); // Get standby timer
|
|
192
|
+
setAuto(token, mac, true); // Enable/disable auto mode
|
|
193
|
+
getAuto(token, mac); // Get auto mode status
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Temperature Control
|
|
197
|
+
|
|
198
|
+
```js
|
|
199
|
+
setTargetTemperature(token, mac, 22); // Set zone 1 temperature
|
|
200
|
+
getTargetTemperature(token, mac); // Get zone 1 target
|
|
201
|
+
getEnvironmentTemperature(token, mac); // Get ambient temperature
|
|
202
|
+
setEnvironment2Temperature(token, mac, 20); // Set zone 2 temperature
|
|
203
|
+
getEnvironment2Temperature(token, mac); // Get zone 2 target
|
|
204
|
+
setEnvironment3Temperature(token, mac, 18); // Set zone 3 temperature
|
|
205
|
+
getEnvironment3Temperature(token, mac); // Get zone 3 target
|
|
206
|
+
```
|
|
207
|
+
|
|
157
208
|
## Roadmap
|
|
158
209
|
|
|
159
210
|
- [x] AWS Amplify/ Cognito authentication
|
|
@@ -161,7 +212,11 @@ const wifiMac = bleToWifiMac(bleMac); // "a8032afed508"
|
|
|
161
212
|
- [x] authenticated endpoint call
|
|
162
213
|
- [ ] ~list stoves~
|
|
163
214
|
- [x] turn stove on/off
|
|
164
|
-
- [
|
|
215
|
+
- [x] set temperature
|
|
216
|
+
- [x] power level control
|
|
217
|
+
- [x] fan speed control
|
|
218
|
+
- [x] operating modes (Airkare, Relax, Standby, Auto)
|
|
219
|
+
- [x] multi-zone temperature control
|
|
165
220
|
|
|
166
221
|
## Limitations
|
|
167
222
|
|
package/dist/cjs/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/cjs/src/cli.js
CHANGED
|
@@ -153,6 +153,11 @@ const createProgram = () => {
|
|
|
153
153
|
description: "Retrieve device power status",
|
|
154
154
|
getter: (api, jwtToken, mac) => api.getPower(jwtToken, mac),
|
|
155
155
|
},
|
|
156
|
+
{
|
|
157
|
+
commandName: "getPowerLevel",
|
|
158
|
+
description: "Retrieve manual power level (1-5)",
|
|
159
|
+
getter: (api, jwtToken, mac) => api.getPowerLevel(jwtToken, mac),
|
|
160
|
+
},
|
|
156
161
|
{
|
|
157
162
|
commandName: "getEnvironmentTemperature",
|
|
158
163
|
description: "Retrieve environment temperature",
|
|
@@ -163,6 +168,66 @@ const createProgram = () => {
|
|
|
163
168
|
description: "Retrieve target temperature",
|
|
164
169
|
getter: (api, jwtToken, mac) => api.getTargetTemperature(jwtToken, mac),
|
|
165
170
|
},
|
|
171
|
+
{
|
|
172
|
+
commandName: "getFan1Speed",
|
|
173
|
+
description: "Retrieve fan 1 speed",
|
|
174
|
+
getter: (api, jwtToken, mac) => api.getFan1Speed(jwtToken, mac),
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
commandName: "getFan2Speed",
|
|
178
|
+
description: "Retrieve fan 2 speed",
|
|
179
|
+
getter: (api, jwtToken, mac) => api.getFan2Speed(jwtToken, mac),
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
commandName: "getFan3Speed",
|
|
183
|
+
description: "Retrieve fan 3 speed",
|
|
184
|
+
getter: (api, jwtToken, mac) => api.getFan3Speed(jwtToken, mac),
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
commandName: "getStandby",
|
|
188
|
+
description: "Retrieve Standby mode status",
|
|
189
|
+
getter: (api, jwtToken, mac) => api.getStandby(jwtToken, mac),
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
commandName: "getStandbyTime",
|
|
193
|
+
description: "Retrieve standby waiting time in minutes",
|
|
194
|
+
getter: (api, jwtToken, mac) => api.getStandbyTime(jwtToken, mac),
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
commandName: "getAuto",
|
|
198
|
+
description: "Retrieve Auto mode status",
|
|
199
|
+
getter: (api, jwtToken, mac) => api.getAuto(jwtToken, mac),
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
commandName: "getEnvironment2Temperature",
|
|
203
|
+
description: "Retrieve Environment 2 target temperature",
|
|
204
|
+
getter: (api, jwtToken, mac) => api.getEnvironment2Temperature(jwtToken, mac),
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
commandName: "getEnvironment3Temperature",
|
|
208
|
+
description: "Retrieve Environment 3 target temperature",
|
|
209
|
+
getter: (api, jwtToken, mac) => api.getEnvironment3Temperature(jwtToken, mac),
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
commandName: "getMeasureUnit",
|
|
213
|
+
description: "Retrieve temperature unit (true=Fahrenheit, false=Celsius)",
|
|
214
|
+
getter: (api, jwtToken, mac) => api.getMeasureUnit(jwtToken, mac),
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
commandName: "getLanguage",
|
|
218
|
+
description: "Retrieve display language code (0-9)",
|
|
219
|
+
getter: (api, jwtToken, mac) => api.getLanguage(jwtToken, mac),
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
commandName: "getPelletInReserve",
|
|
223
|
+
description: "Retrieve pellet reserve status (true=low/reserve, false=ok)",
|
|
224
|
+
getter: (api, jwtToken, mac) => api.getPelletInReserve(jwtToken, mac),
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
commandName: "getPelletAutonomyTime",
|
|
228
|
+
description: "Retrieve estimated pellet autonomy time",
|
|
229
|
+
getter: (api, jwtToken, mac) => api.getPelletAutonomyTime(jwtToken, mac),
|
|
230
|
+
},
|
|
166
231
|
].forEach(({ commandName, description, getter }) => {
|
|
167
232
|
addLegacyOption(addMacOption(addAuthOptions(program.command(commandName).description(description)))).action((options) => executeGetter(options, getter));
|
|
168
233
|
});
|
|
@@ -173,11 +238,76 @@ const createProgram = () => {
|
|
|
173
238
|
description: "Set the power state of the device (1 for ON, 0 for OFF)",
|
|
174
239
|
setter: (api, jwtToken, mac, value) => api.setPower(jwtToken, mac, value),
|
|
175
240
|
},
|
|
241
|
+
{
|
|
242
|
+
commandName: "setPowerLevel",
|
|
243
|
+
description: "Set manual power level (1-5)",
|
|
244
|
+
setter: (api, jwtToken, mac, value) => api.setPowerLevel(jwtToken, mac, value),
|
|
245
|
+
},
|
|
176
246
|
{
|
|
177
247
|
commandName: "setTargetTemperature",
|
|
178
248
|
description: "Set the target temperature (degree celsius) for a device",
|
|
179
249
|
setter: (api, jwtToken, mac, value) => api.setTargetTemperature(jwtToken, mac, value),
|
|
180
250
|
},
|
|
251
|
+
{
|
|
252
|
+
commandName: "setFan1Speed",
|
|
253
|
+
description: "Set fan 1 speed (0-5)",
|
|
254
|
+
setter: (api, jwtToken, mac, value) => api.setFan1Speed(jwtToken, mac, value),
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
commandName: "setFan2Speed",
|
|
258
|
+
description: "Set fan 2 speed (0-5)",
|
|
259
|
+
setter: (api, jwtToken, mac, value) => api.setFan2Speed(jwtToken, mac, value),
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
commandName: "setFan3Speed",
|
|
263
|
+
description: "Set fan 3 speed (0-5)",
|
|
264
|
+
setter: (api, jwtToken, mac, value) => api.setFan3Speed(jwtToken, mac, value),
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
commandName: "setAirkare",
|
|
268
|
+
description: "Enable/disable Airkare mode (1=on, 0=off)",
|
|
269
|
+
setter: (api, jwtToken, mac, value) => api.setAirkare(jwtToken, mac, value === 1),
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
commandName: "setRelax",
|
|
273
|
+
description: "Enable/disable Relax mode (1=on, 0=off)",
|
|
274
|
+
setter: (api, jwtToken, mac, value) => api.setRelax(jwtToken, mac, value === 1),
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
commandName: "setStandby",
|
|
278
|
+
description: "Enable/disable Standby mode (1=on, 0=off)",
|
|
279
|
+
setter: (api, jwtToken, mac, value) => api.setStandby(jwtToken, mac, value === 1),
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
commandName: "setStandbyTime",
|
|
283
|
+
description: "Set standby waiting time in minutes",
|
|
284
|
+
setter: (api, jwtToken, mac, value) => api.setStandbyTime(jwtToken, mac, value),
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
commandName: "setAuto",
|
|
288
|
+
description: "Enable/disable Auto mode (1=on, 0=off)",
|
|
289
|
+
setter: (api, jwtToken, mac, value) => api.setAuto(jwtToken, mac, value === 1),
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
commandName: "setEnvironment2Temperature",
|
|
293
|
+
description: "Set Environment 2 target temperature (degrees Celsius)",
|
|
294
|
+
setter: (api, jwtToken, mac, value) => api.setEnvironment2Temperature(jwtToken, mac, value),
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
commandName: "setEnvironment3Temperature",
|
|
298
|
+
description: "Set Environment 3 target temperature (degrees Celsius)",
|
|
299
|
+
setter: (api, jwtToken, mac, value) => api.setEnvironment3Temperature(jwtToken, mac, value),
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
commandName: "setMeasureUnit",
|
|
303
|
+
description: "Set temperature unit (1=Fahrenheit, 0=Celsius)",
|
|
304
|
+
setter: (api, jwtToken, mac, value) => api.setMeasureUnit(jwtToken, mac, value === 1),
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
commandName: "setLanguage",
|
|
308
|
+
description: "Set display language (0=IT,1=FR,2=EN,3=ES,4=PT,5=DA,6=NL,7=DE,8=HU,9=PL)",
|
|
309
|
+
setter: (api, jwtToken, mac, value) => api.setLanguage(jwtToken, mac, value),
|
|
310
|
+
},
|
|
181
311
|
].forEach(({ commandName, description, setter }) => {
|
|
182
312
|
addLegacyOption(addMacOption(addAuthOptions(program.command(commandName).description(description)).requiredOption("-v, --value <number>", "Value to set", parseFloat))).action((options) => executeSetter(options, setter));
|
|
183
313
|
});
|
|
@@ -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/cjs/src/library.js
CHANGED
|
@@ -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;
|