homebridge-melcloud-control 4.2.3-beta.23 → 4.2.3-beta.25

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.2.3-beta.23",
4
+ "version": "4.2.3-beta.25",
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
@@ -29,13 +29,9 @@ class MelCloud extends EventEmitter {
29
29
  if (pluginStart) {
30
30
  //lock flags
31
31
  this.locks = {
32
- connect: false,
33
32
  checkDevicesList: false
34
33
  };
35
34
  this.impulseGenerator = new ImpulseGenerator()
36
- .on('connect', () => this.handleWithLock('connect', async () => {
37
- await this.connect();
38
- }))
39
35
  .on('checkDevicesList', () => this.handleWithLock('checkDevicesList', async () => {
40
36
  await this.checkDevicesList();
41
37
  }))
@@ -119,6 +115,7 @@ class MelCloud extends EventEmitter {
119
115
  devicesList.Info = 'No devices found'
120
116
  return devicesList;
121
117
  }
118
+
122
119
  devicesList.State = true;
123
120
  devicesList.Info = `Found ${devicesCount} devices`;
124
121
  devicesList.Devices = devices;
@@ -176,8 +176,8 @@ class MelCloud extends EventEmitter {
176
176
  return devicesList;
177
177
  } catch (error) {
178
178
  if (error.response?.status === 401) {
179
- await connectToMelCloudHome();
180
179
  if (this.logWarn) this.emit('warn', 'Check devices list not possible, cookies expired, trying to get new.');
180
+ await this.connect();
181
181
  return;
182
182
  }
183
183