daikin-airbase 0.1.2 → 0.1.3
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/dist/index.cjs +4 -3
- package/dist/index.mjs +4 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -308,15 +308,16 @@ var DaikinClient = class {
|
|
|
308
308
|
async setControlInfo(info) {
|
|
309
309
|
const latest = await this.getControlInfo();
|
|
310
310
|
const update = { ...latest, ...info };
|
|
311
|
+
const int = (v) => Math.round(v);
|
|
311
312
|
const bool = (v) => v ? 1 : 0;
|
|
312
313
|
const response = await set_control_info(this.api, {
|
|
313
314
|
f_airside: bool(update.fanAirside),
|
|
314
315
|
f_auto: bool(update.fanAuto),
|
|
315
316
|
f_dir: bool(update.swinging),
|
|
316
|
-
f_rate: update.fanSpeed,
|
|
317
|
-
mode: update.mode,
|
|
317
|
+
f_rate: int(update.fanSpeed),
|
|
318
|
+
mode: int(update.mode),
|
|
318
319
|
pow: bool(update.power),
|
|
319
|
-
stemp: update.targetTemperature
|
|
320
|
+
stemp: int(update.targetTemperature)
|
|
320
321
|
});
|
|
321
322
|
if (response.ret !== "OK")
|
|
322
323
|
throw new Error(`Failed to update control info: ${response.ret}`);
|
package/dist/index.mjs
CHANGED
|
@@ -268,15 +268,16 @@ var DaikinClient = class {
|
|
|
268
268
|
async setControlInfo(info) {
|
|
269
269
|
const latest = await this.getControlInfo();
|
|
270
270
|
const update = { ...latest, ...info };
|
|
271
|
+
const int = (v) => Math.round(v);
|
|
271
272
|
const bool = (v) => v ? 1 : 0;
|
|
272
273
|
const response = await set_control_info(this.api, {
|
|
273
274
|
f_airside: bool(update.fanAirside),
|
|
274
275
|
f_auto: bool(update.fanAuto),
|
|
275
276
|
f_dir: bool(update.swinging),
|
|
276
|
-
f_rate: update.fanSpeed,
|
|
277
|
-
mode: update.mode,
|
|
277
|
+
f_rate: int(update.fanSpeed),
|
|
278
|
+
mode: int(update.mode),
|
|
278
279
|
pow: bool(update.power),
|
|
279
|
-
stemp: update.targetTemperature
|
|
280
|
+
stemp: int(update.targetTemperature)
|
|
280
281
|
});
|
|
281
282
|
if (response.ret !== "OK")
|
|
282
283
|
throw new Error(`Failed to update control info: ${response.ret}`);
|