homebridge-melcloud-control 4.0.0-beta.162 → 4.0.0-beta.164
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/package.json +1 -1
- package/src/melcloudata.js +5 -16
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.164",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
package/src/melcloudata.js
CHANGED
|
@@ -194,10 +194,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
194
194
|
async send(accountType, displayMode, deviceData) {
|
|
195
195
|
try {
|
|
196
196
|
switch (accountType) {
|
|
197
|
-
|
|
198
|
-
// MELCloud standard account
|
|
199
|
-
// ----------------------------------------------------------
|
|
200
|
-
case "melcloud": {
|
|
197
|
+
case "melcloud":
|
|
201
198
|
const axiosInstancePost = axios.create({
|
|
202
199
|
baseURL: ApiUrls.BaseURL,
|
|
203
200
|
timeout: 25000,
|
|
@@ -263,12 +260,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
263
260
|
await axiosInstancePost.post(ApiUrls.SetAta, payload);
|
|
264
261
|
this.emit('deviceState', deviceData);
|
|
265
262
|
return true;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
// ----------------------------------------------------------
|
|
269
|
-
// MELCloud Home account
|
|
270
|
-
// ----------------------------------------------------------
|
|
271
|
-
case "melcloudhome": {
|
|
263
|
+
case "melcloudhome":
|
|
272
264
|
const axiosInstancePut = axios.create({
|
|
273
265
|
baseURL: ApiUrlsHome.BaseURL,
|
|
274
266
|
timeout: 25000,
|
|
@@ -300,7 +292,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
300
292
|
|
|
301
293
|
this.emit('warn', JSON.stringify(deviceData.Device, null, 2));
|
|
302
294
|
|
|
303
|
-
const
|
|
295
|
+
const data = {
|
|
304
296
|
data: {
|
|
305
297
|
Power: deviceData.Device.Power,
|
|
306
298
|
SetTemperature: deviceData.Device.SetTemperature,
|
|
@@ -311,14 +303,11 @@ class MelCloudAta extends EventEmitter {
|
|
|
311
303
|
}
|
|
312
304
|
};
|
|
313
305
|
|
|
314
|
-
this.emit('warn', JSON.stringify(
|
|
306
|
+
this.emit('warn', JSON.stringify(data, null, 2));
|
|
315
307
|
|
|
316
308
|
const path = ApiUrlsHome.SetAta.replace('deviceid', deviceData.DeviceID);
|
|
317
|
-
await axiosInstancePut.put(path,
|
|
318
|
-
|
|
309
|
+
await axiosInstancePut.put(path, data);
|
|
319
310
|
return true;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
311
|
default:
|
|
323
312
|
return;
|
|
324
313
|
}
|