homebridge-melcloud-control 2.5.0-beta.16 → 2.5.0-beta.17

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/melcloud.js +10 -11
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "2.5.0-beta.16",
4
+ "version": "2.5.0-beta.17",
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
@@ -122,21 +122,20 @@ class MelCloud extends EventEmitter {
122
122
  await this.saveData(this.accountInfoFile, accountInfo);
123
123
 
124
124
  //return if connect for config
125
- if (this.connectForConfig) {
126
- return;
127
- };
125
+ if (!this.connectForConfig) {
128
126
 
129
- //check devices list
130
- await this.chackDevicesList();
127
+ //check devices list
128
+ await this.chackDevicesList();
131
129
 
132
- //emit connect success
133
- this.emit('success', `Connect to MELCloud Success.`)
130
+ //emit connect success
131
+ this.emit('success', `Connect to MELCloud Success.`)
134
132
 
135
- //start impulse generator
136
- const timers = [{ name: 'checkDevicesList', sampling: this.refreshInterval }];
137
- this.impulseGenerator.start(timers);
133
+ //start impulse generator
134
+ const timers = [{ name: 'checkDevicesList', sampling: this.refreshInterval }];
135
+ this.impulseGenerator.start(timers);
138
136
 
139
- return true;
137
+ return true;
138
+ };
140
139
  } catch (error) {
141
140
  this.emit('error', `Connect to MELCloud error: ${error.message ?? error}.`);
142
141
  };