homebridge-melcloud-control 4.0.0-beta.555 → 4.0.0-beta.556

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.0.0-beta.555",
4
+ "version": "4.0.0-beta.556",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -52,7 +52,6 @@ class MelCloudAta extends EventEmitter {
52
52
  try {
53
53
  //read device info from file
54
54
  const devicesData = await this.functions.readData(this.devicesFile, true);
55
-
56
55
  if (!Array.isArray(devicesData)) {
57
56
  if (this.logWarn) this.emit('warn', `Device data not found`);
58
57
  return null;
@@ -75,8 +74,8 @@ class MelCloudAta extends EventEmitter {
75
74
  if (this.logDebug) this.emit('debug', `Device Data: ${JSON.stringify(deviceData, null, 2)}`);
76
75
 
77
76
  //device info
78
- const hideVaneControls = deviceData.HideVaneControls ?? false;
79
- const hideDryModeControl = deviceData.HideDryModeControl ?? false;
77
+ const hideVaneControls = deviceData.HideVaneControls;
78
+ const hideDryModeControl = deviceData.HideDryModeControl;
80
79
  const serialNumber = deviceData.SerialNumber;
81
80
 
82
81
  //device
@@ -147,7 +146,8 @@ class MelCloudAta extends EventEmitter {
147
146
  ProhibitOperationMode: prohibitOperationMode,
148
147
  HideVaneControls: hideVaneControls,
149
148
  HideDryModeControl: hideDryModeControl,
150
- IsInError: isInError
149
+ IsInError: isInError,
150
+ Headers: deviceData.Headers
151
151
  }
152
152
 
153
153
  //restFul
@@ -185,11 +185,8 @@ class MelCloudAta extends EventEmitter {
185
185
  const axiosInstancePost = axios.create({
186
186
  method: 'POST',
187
187
  baseURL: ApiUrls.BaseURL,
188
- timeout: 25000,
189
- headers: {
190
- 'X-MitsContextKey': deviceData.ContextKey,
191
- 'Content-Type': 'application/json'
192
- },
188
+ timeout: 10000,
189
+ headers: deviceData.Headers,
193
190
  withCredentials: true
194
191
  });
195
192
 
@@ -227,8 +224,9 @@ class MelCloudAta extends EventEmitter {
227
224
  const axiosInstancePut = axios.create({
228
225
  method: 'PUT',
229
226
  baseURL: ApiUrlsHome.BaseURL,
230
- timeout: 25000,
231
- headers: deviceData.Headers
227
+ timeout: 10000,
228
+ headers: deviceData.Headers,
229
+ withCredentials: true
232
230
  });
233
231
 
234
232
  if (displayType === 1 && deviceData.Device.OperationMode === 8) {
@@ -148,7 +148,8 @@ class MelCloudAtw extends EventEmitter {
148
148
  ProhibitZone1: prohibitHeatingZone1,
149
149
  ProhibitZone2: prohibitHeatingZone2,
150
150
  ProhibitHotWater: prohibitHotWater,
151
- IsInError: isInError
151
+ IsInError: isInError,
152
+ Headers: deviceData.Headers
152
153
  }
153
154
 
154
155
  //restFul
@@ -186,11 +187,8 @@ class MelCloudAtw extends EventEmitter {
186
187
  const axiosInstancePost = axios.create({
187
188
  method: 'POST',
188
189
  baseURL: ApiUrls.BaseURL,
189
- timeout: 25000,
190
- headers: {
191
- 'X-MitsContextKey': deviceData.ContextKey,
192
- 'Content-Type': 'application/json'
193
- },
190
+ timeout: 10000,
191
+ headers: deviceData.Headers,
194
192
  withCredentials: true
195
193
  });
196
194
 
@@ -240,20 +238,9 @@ class MelCloudAtw extends EventEmitter {
240
238
  const axiosInstancePut = axios.create({
241
239
  method: 'PUT',
242
240
  baseURL: ApiUrlsHome.BaseURL,
243
- timeout: 25000,
244
- headers: {
245
- 'Accept': '*/*',
246
- 'Accept-Language': 'en-US,en;q=0.9',
247
- 'Cookie': deviceData.ContextKey,
248
- 'User-Agent': 'homebridge-melcloud-control/4.0.0',
249
- 'DNT': '1',
250
- 'Origin': 'https://melcloudhome.com',
251
- 'Referer': 'https://melcloudhome.com/dashboard',
252
- 'Sec-Fetch-Dest': 'empty',
253
- 'Sec-Fetch-Mode': 'cors',
254
- 'Sec-Fetch-Site': 'same-origin',
255
- 'X-CSRF': '1'
256
- }
241
+ timeout: 10000,
242
+ headers: deviceData.Headers,
243
+ withCredentials: true
257
244
  });
258
245
 
259
246
  if (displayType === 1 && deviceData.Device.OperationMode === 8) {
@@ -140,7 +140,8 @@ class MelCloudErv extends EventEmitter {
140
140
  HideRoomTemperature: hideRoomTemperature,
141
141
  HideSupplyTemperature: hideSupplyTemperature,
142
142
  HideOutdoorTemperature: hideOutdoorTemperature,
143
- IsInError: isInError
143
+ IsInError: isInError,
144
+ Headers: deviceData.Headers
144
145
  }
145
146
 
146
147
  //restFul
@@ -178,11 +179,8 @@ class MelCloudErv extends EventEmitter {
178
179
  const axiosInstancePost = axios.create({
179
180
  method: 'POST',
180
181
  baseURL: ApiUrls.BaseURL,
181
- timeout: 25000,
182
- headers: {
183
- 'X-MitsContextKey': deviceData.ContextKey,
184
- 'Content-Type': 'application/json'
185
- },
182
+ timeout: 10000,
183
+ headers: deviceData.Headers,
186
184
  withCredentials: true
187
185
  });
188
186
 
@@ -234,20 +232,9 @@ class MelCloudErv extends EventEmitter {
234
232
  const axiosInstancePut = axios.create({
235
233
  method: 'PUT',
236
234
  baseURL: ApiUrlsHome.BaseURL,
237
- timeout: 25000,
238
- headers: {
239
- 'Accept': '*/*',
240
- 'Accept-Language': 'en-US,en;q=0.9',
241
- 'Cookie': deviceData.ContextKey,
242
- 'User-Agent': 'homebridge-melcloud-control/4.0.0',
243
- 'DNT': '1',
244
- 'Origin': 'https://melcloudhome.com',
245
- 'Referer': 'https://melcloudhome.com/dashboard',
246
- 'Sec-Fetch-Dest': 'empty',
247
- 'Sec-Fetch-Mode': 'cors',
248
- 'Sec-Fetch-Site': 'same-origin',
249
- 'X-CSRF': '1'
250
- }
235
+ timeout: 10000,
236
+ headers: deviceData.Headers,
237
+ withCredentials: true
251
238
  });
252
239
 
253
240
  if (displayType === 1 && deviceData.Device.OperationMode === 8) {