homebridge-melcloud-control 4.0.0-beta.455 → 4.0.0-beta.457

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.
@@ -230,7 +230,10 @@
230
230
 
231
231
  try {
232
232
  const account = pluginConfig[0].accounts[this.accountIndex];
233
- const devicesInMelCloud = await homebridge.request('/connect', account);
233
+ const devicesInMelCloud = await Promise.race([
234
+ homebridge.request('/connect', account),
235
+ new Promise((_, reject) => setTimeout(() => reject(new Error('Connection timeout (30s)')), 30000))
236
+ ]);
234
237
 
235
238
  // Initialize devices arrays
236
239
  const newDevices = { ata: [], ataPresets: [], atw: [], atwPresets: [], erv: [], ervPresets: [] };
package/index.js CHANGED
@@ -201,7 +201,7 @@ class MelCloudPlatform {
201
201
  if (logLevel.success) log.success(`${accountName}, ${deviceTypeText}, ${deviceName}, Published as external accessory.`);
202
202
 
203
203
  //start impulse generators\
204
- const timmers = accountType === 'melcloudhome' ? [{ name: 'connect', sampling: 150000 }, { name: 'checkDevicesList', sampling: deviceRefreshInterval }] : [{ name: 'checkDevicesList', sampling: refreshInterval }];
204
+ const timmers = accountType === 'melcloudhome' ? [{ name: 'connect', sampling: 300000 }, { name: 'checkDevicesList', sampling: deviceRefreshInterval }] : [{ name: 'checkDevicesList', sampling: refreshInterval }];
205
205
  await melCloud.impulseGenerator.state(true, timmers);
206
206
  await configuredDevice.startStopImpulseGenerator(true, [{ name: 'checkState', sampling: deviceRefreshInterval }]);
207
207
 
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.455",
4
+ "version": "4.0.0-beta.457",
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/constants.js CHANGED
@@ -35,7 +35,7 @@ export const DeviceType = [
35
35
  export const TemperatureDisplayUnits = ["°C", "°F"];
36
36
 
37
37
  export const AirConditioner = {
38
- SystemMapEnumToString: { 0: "Air Conditioner Off", 1: "ir Conditioner On", 2: "ir Conditioner Offline" },
38
+ SystemMapEnumToString: { 0: "Air Conditioner Off", 1: "Air Conditioner On", 2: "Air Conditioner Offline" },
39
39
  AirDirectionMapEnumToString: { 0: "Auto", 1: "Swing" },
40
40
  CurrentOperationModeHeatherCoolerMapEnumToString: { 0: "Inactive", 1: "Idle", 2: "Heating", 3: "Cooling" },
41
41
  CurrentOperationModeThermostatMapEnumToString: { 0: "Inactive", 1: "Heating", 2: "Cooling" },
package/src/melcloud.js CHANGED
@@ -318,7 +318,7 @@ class MelCloud extends EventEmitter {
318
318
  });
319
319
 
320
320
  // Wait for Puppeteer target to be ready (browser internal page)
321
- await new Promise(r => setTimeout(r, 500));
321
+ await new Promise(r => setTimeout(r, 1000));
322
322
 
323
323
  // Defensive check for main frame availability
324
324
  const pages = await browser.pages();
@@ -339,11 +339,9 @@ class MelCloud extends EventEmitter {
339
339
  page.setDefaultTimeout(30000);
340
340
  page.setDefaultNavigationTimeout(30000);
341
341
 
342
- // Now safe to navigate
342
+ // Now safe to navigate
343
343
  await page.goto(ApiUrlsHome.BaseURL, { waitUntil: ['domcontentloaded', 'networkidle2'] });
344
344
 
345
-
346
-
347
345
  const buttons = await page.$$('button.btn--blue');
348
346
  let loginBtn = null;
349
347
  for (const btn of buttons) {