homebridge-melcloud-control 4.0.0-beta.41 → 4.0.0-beta.42
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/config.schema.json +3 -3
- package/homebridge-ui/public/index.html +3 -3
- package/index.js +4 -4
- package/package.json +1 -1
- package/src/melcloud.js +8 -9
package/config.schema.json
CHANGED
|
@@ -212,19 +212,19 @@
|
|
|
212
212
|
{
|
|
213
213
|
"title": "None/Disabled",
|
|
214
214
|
"enum": [
|
|
215
|
-
"
|
|
215
|
+
"disabled"
|
|
216
216
|
]
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
219
|
"title": "MELCLoud",
|
|
220
220
|
"enum": [
|
|
221
|
-
"
|
|
221
|
+
"melcloud"
|
|
222
222
|
]
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
"title": "MELCLoud Home",
|
|
226
226
|
"enum": [
|
|
227
|
-
"
|
|
227
|
+
"melcloudhome"
|
|
228
228
|
]
|
|
229
229
|
}
|
|
230
230
|
]
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
<div class="mb-2">
|
|
80
80
|
<label for="displayType" class="form-label">Account Type</label>
|
|
81
81
|
<select id="displayType" name="displayType" class="form-control">
|
|
82
|
-
<option value="
|
|
83
|
-
<option value="
|
|
84
|
-
<option value="
|
|
82
|
+
<option value="disabled">None/Disabled</option>
|
|
83
|
+
<option value="melcloud">MELCloud</option>
|
|
84
|
+
<option value="melcloudhome">MELCloud Home</option>
|
|
85
85
|
</select>
|
|
86
86
|
</div>
|
|
87
87
|
|
package/index.js
CHANGED
|
@@ -30,8 +30,8 @@ class MelCloudPlatform {
|
|
|
30
30
|
api.on('didFinishLaunching', async () => {
|
|
31
31
|
//loop through accounts
|
|
32
32
|
for (const account of config.accounts) {
|
|
33
|
-
const displayType = account.displayType ||
|
|
34
|
-
if (displayType ===
|
|
33
|
+
const displayType = account.displayType || 'disabled';
|
|
34
|
+
if (displayType === 'disabled') continue;
|
|
35
35
|
|
|
36
36
|
const accountName = account.name;
|
|
37
37
|
const user = account.user;
|
|
@@ -106,9 +106,9 @@ class MelCloudPlatform {
|
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
const accountInfo = response.accountInfo
|
|
109
|
+
const accountInfo = response.accountInfo;
|
|
110
110
|
const contextKey = response.contextKey;
|
|
111
|
-
const useFahrenheit = response.useFahrenheit
|
|
111
|
+
const useFahrenheit = response.useFahrenheit;
|
|
112
112
|
|
|
113
113
|
if (!contextKey) {
|
|
114
114
|
return;
|
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.
|
|
4
|
+
"version": "4.0.0-beta.42",
|
|
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
|
@@ -268,7 +268,6 @@ class MelCloud extends EventEmitter {
|
|
|
268
268
|
const useFahrenheit = false;
|
|
269
269
|
this.contextKey = contextKey;
|
|
270
270
|
|
|
271
|
-
|
|
272
271
|
this.emit('success', `Connect to MELCloud Home Success`);
|
|
273
272
|
|
|
274
273
|
return { accountInfo, contextKey, useFahrenheit };
|
|
@@ -280,30 +279,30 @@ class MelCloud extends EventEmitter {
|
|
|
280
279
|
}
|
|
281
280
|
|
|
282
281
|
async connect() {
|
|
283
|
-
let response =
|
|
282
|
+
let response = {};
|
|
284
283
|
switch (this.displayType) {
|
|
285
|
-
case "
|
|
284
|
+
case "melcloud":
|
|
286
285
|
response = await this.connectToMelCloud();
|
|
287
286
|
return response
|
|
288
|
-
case "
|
|
287
|
+
case "melcloudhome":
|
|
289
288
|
response = await this.connectToMelCloudHome();
|
|
290
289
|
return response
|
|
291
290
|
default:
|
|
292
|
-
return
|
|
291
|
+
return response
|
|
293
292
|
}
|
|
294
293
|
}
|
|
295
294
|
|
|
296
295
|
async checkDevicesList(contextKey) {
|
|
297
|
-
let devices =
|
|
296
|
+
let devices = [];
|
|
298
297
|
switch (this.displayType) {
|
|
299
|
-
case "
|
|
298
|
+
case "melcloud":
|
|
300
299
|
devices = await this.checkMelcloudDevicesList(contextKey);
|
|
301
300
|
return devices
|
|
302
|
-
case "
|
|
301
|
+
case "melcloudhome":
|
|
303
302
|
devices = await this.checkMelcloudHomeDevicesList(contextKey);
|
|
304
303
|
return devices
|
|
305
304
|
default:
|
|
306
|
-
return
|
|
305
|
+
return devices;
|
|
307
306
|
}
|
|
308
307
|
}
|
|
309
308
|
|