homebridge-melcloud-control 4.0.0-beta.34 → 4.0.0-beta.35

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/index.js CHANGED
@@ -107,10 +107,10 @@ class MelCloudPlatform {
107
107
  }
108
108
 
109
109
  const accountInfo = response.accountInfo ?? false;
110
- const contextKey = displayType === 1 ? response.contextKey : response;
110
+ const contextKey = response.contextKey;
111
111
  const useFahrenheit = response.useFahrenheit ?? false;
112
112
 
113
- if (contextKey === false) {
113
+ if (!contextKey) {
114
114
  return;
115
115
  }
116
116
 
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.34",
4
+ "version": "4.0.0-beta.35",
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/melcloud.js CHANGED
@@ -163,8 +163,6 @@ class MelCloud extends EventEmitter {
163
163
  }
164
164
 
165
165
  async checkMelcloudHomeDevicesList(cookies) {
166
- if (this.logDebug) this.emit('debug', `Connecting to MELCloud Home`);
167
-
168
166
  try {
169
167
  const c1 = cookies.c1.trim();
170
168
  const c2 = cookies.c2.trim();
@@ -177,7 +175,7 @@ class MelCloud extends EventEmitter {
177
175
 
178
176
  const axiosInstance = axios.create({
179
177
  baseURL: ApiUrlsHome.BaseURL,
180
- timeout: 10000,
178
+ timeout: 20000,
181
179
  httpsAgent: new Agent({
182
180
  keepAlive: false,
183
181
  rejectUnauthorized: false
@@ -276,12 +274,15 @@ class MelCloud extends EventEmitter {
276
274
  if (this.logWarn) this.emit('warn', `Cookies C1/C2 missing`);
277
275
  return null;
278
276
  }
279
- const cookies = { c1, c2 };
280
- this.contextKey = cookies;
277
+
278
+ const accountInfo = {};
279
+ const contextKey = { c1, c2 };
280
+ const useFahrenheit = false;
281
+ this.contextKey = contextKey;
281
282
 
282
283
  this.emit('success', `Connect to MELCloud Home Success`);
283
284
 
284
- return cookies;
285
+ return { accountInfo, contextKey, useFahrenheit };
285
286
  } catch (error) {
286
287
  throw new Error(`Connect to MELCloud Home error: ${error.message}`);
287
288
  } finally {