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.
- package/package.json +1 -1
- 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.
|
|
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
|
-
|
|
130
|
-
|
|
127
|
+
//check devices list
|
|
128
|
+
await this.chackDevicesList();
|
|
131
129
|
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
//emit connect success
|
|
131
|
+
this.emit('success', `Connect to MELCloud Success.`)
|
|
134
132
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
//start impulse generator
|
|
134
|
+
const timers = [{ name: 'checkDevicesList', sampling: this.refreshInterval }];
|
|
135
|
+
this.impulseGenerator.start(timers);
|
|
138
136
|
|
|
139
|
-
|
|
137
|
+
return true;
|
|
138
|
+
};
|
|
140
139
|
} catch (error) {
|
|
141
140
|
this.emit('error', `Connect to MELCloud error: ${error.message ?? error}.`);
|
|
142
141
|
};
|