homebridge-melcloud-control 4.0.0-beta.36 → 4.0.0-beta.38
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 +4 -4
- package/homebridge-ui/public/index.html +5 -5
- package/package.json +1 -1
- package/src/melcloud.js +4 -4
package/config.schema.json
CHANGED
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
},
|
|
204
204
|
"displayType": {
|
|
205
205
|
"title": "Account Type",
|
|
206
|
-
"type": "
|
|
206
|
+
"type": "string",
|
|
207
207
|
"minimum": 0,
|
|
208
208
|
"maximum": 2,
|
|
209
209
|
"default": 1,
|
|
@@ -212,19 +212,19 @@
|
|
|
212
212
|
{
|
|
213
213
|
"title": "None/Disabled",
|
|
214
214
|
"enum": [
|
|
215
|
-
0
|
|
215
|
+
"0"
|
|
216
216
|
]
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
219
|
"title": "MELCLoud",
|
|
220
220
|
"enum": [
|
|
221
|
-
1
|
|
221
|
+
"1"
|
|
222
222
|
]
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
"title": "MELCLoud Home",
|
|
226
226
|
"enum": [
|
|
227
|
-
2
|
|
227
|
+
"2"
|
|
228
228
|
]
|
|
229
229
|
}
|
|
230
230
|
]
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
document.getElementById('user').value = acc.user || '';
|
|
129
129
|
document.getElementById('passwd').value = acc.passwd || '';
|
|
130
130
|
document.getElementById('language').value = acc.language || '';
|
|
131
|
-
document.getElementById('accountType').value = acc.
|
|
132
|
-
document.getElementById('logIn').disabled = !(acc.name && acc.user && acc.passwd && acc.language && acc.
|
|
131
|
+
document.getElementById('accountType').value = acc.displayType || '';
|
|
132
|
+
document.getElementById('logIn').disabled = !(acc.name && acc.user && acc.passwd && acc.language && acc.displayType);
|
|
133
133
|
this.deviceIndex = i;
|
|
134
134
|
});
|
|
135
135
|
|
|
@@ -144,9 +144,9 @@
|
|
|
144
144
|
acc.user = document.querySelector('#user').value;
|
|
145
145
|
acc.passwd = document.querySelector('#passwd').value;
|
|
146
146
|
acc.language = document.querySelector('#language').value;
|
|
147
|
-
acc.
|
|
147
|
+
acc.displayType = document.querySelector('#accountType').value;
|
|
148
148
|
|
|
149
|
-
document.getElementById('logIn').disabled = !(acc.name && acc.user && acc.passwd && acc.languaged && acc.
|
|
149
|
+
document.getElementById('logIn').disabled = !(acc.name && acc.user && acc.passwd && acc.languaged && acc.displayType);
|
|
150
150
|
|
|
151
151
|
await homebridge.updatePluginConfig(pluginConfig);
|
|
152
152
|
await homebridge.savePluginConfig(pluginConfig);
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
|
|
204
204
|
try {
|
|
205
205
|
const acc = pluginConfig[0].accounts[this.deviceIndex];
|
|
206
|
-
const payload = { accountName: acc.name, user: acc.user, passwd: acc.passwd, language: acc.language, accountType: acc.
|
|
206
|
+
const payload = { accountName: acc.name, user: acc.user, passwd: acc.passwd, language: acc.language, accountType: acc.displayType };
|
|
207
207
|
const devicesInMelCloud = await homebridge.request('/connect', payload);
|
|
208
208
|
|
|
209
209
|
// Initialize devices arrays
|
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.38",
|
|
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
|
@@ -293,10 +293,10 @@ class MelCloud extends EventEmitter {
|
|
|
293
293
|
async connect() {
|
|
294
294
|
let response = null;
|
|
295
295
|
switch (this.displayType) {
|
|
296
|
-
case 1:
|
|
296
|
+
case "1":
|
|
297
297
|
response = await this.connectToMelCloud();
|
|
298
298
|
return response
|
|
299
|
-
case 2:
|
|
299
|
+
case "2":
|
|
300
300
|
response = await this.connectToMelCloudHome();
|
|
301
301
|
return response
|
|
302
302
|
default:
|
|
@@ -307,10 +307,10 @@ class MelCloud extends EventEmitter {
|
|
|
307
307
|
async checkDevicesList(key) {
|
|
308
308
|
let devices = null;
|
|
309
309
|
switch (this.displayType) {
|
|
310
|
-
case 1:
|
|
310
|
+
case "1":
|
|
311
311
|
devices = await this.checkMelcloudDevicesList(key);
|
|
312
312
|
return devices
|
|
313
|
-
case 2:
|
|
313
|
+
case "2":
|
|
314
314
|
devices = await this.checkMelcloudHomeDevicesList(key);
|
|
315
315
|
return devices
|
|
316
316
|
default:
|