homebridge-melcloud-control 4.0.0-beta.35 → 4.0.0-beta.37

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.
@@ -76,6 +76,15 @@
76
76
  </select>
77
77
  </div>
78
78
 
79
+ <div class="mb-2">
80
+ <label for="accountType" class="form-label">Account Type</label>
81
+ <select id="accountType" name="accountType" class="form-control">
82
+ <option value="0">None/Disabled</option>
83
+ <option value="1">MELCloud</option>
84
+ <option value="2">MELCloud Home</option>
85
+ </select>
86
+ </div>
87
+
79
88
  <div class="text-center">
80
89
  <button id="logIn" type="button" class="btn btn-secondary">Connect to MELCloud</button>
81
90
  <button id="configButton" type="button" class="btn btn-secondary"><i class="fas fa-gear"></i></button>
@@ -119,7 +128,8 @@
119
128
  document.getElementById('user').value = acc.user || '';
120
129
  document.getElementById('passwd').value = acc.passwd || '';
121
130
  document.getElementById('language').value = acc.language || '';
122
- document.getElementById('logIn').disabled = !(acc.name && acc.user && acc.passwd && acc.language);
131
+ document.getElementById('accountType').value = acc.displayType || '';
132
+ document.getElementById('logIn').disabled = !(acc.name && acc.user && acc.passwd && acc.language && acc.displayType);
123
133
  this.deviceIndex = i;
124
134
  });
125
135
 
@@ -134,8 +144,9 @@
134
144
  acc.user = document.querySelector('#user').value;
135
145
  acc.passwd = document.querySelector('#passwd').value;
136
146
  acc.language = document.querySelector('#language').value;
147
+ acc.displayType = document.querySelector('#accountType').value;
137
148
 
138
- document.getElementById('logIn').disabled = !(acc.name && acc.user && acc.passwd && acc.language);
149
+ document.getElementById('logIn').disabled = !(acc.name && acc.user && acc.passwd && acc.languaged && acc.displayType);
139
150
 
140
151
  await homebridge.updatePluginConfig(pluginConfig);
141
152
  await homebridge.savePluginConfig(pluginConfig);
@@ -192,7 +203,7 @@
192
203
 
193
204
  try {
194
205
  const acc = pluginConfig[0].accounts[this.deviceIndex];
195
- const payload = { accountName: acc.name, user: acc.user, passwd: acc.passwd, language: acc.language };
206
+ const payload = { accountName: acc.name, user: acc.user, passwd: acc.passwd, language: acc.language, accountType: acc.displayType };
196
207
  const devicesInMelCloud = await homebridge.request('/connect', payload);
197
208
 
198
209
  // Initialize devices arrays
@@ -17,10 +17,11 @@ class PluginUiServer extends HomebridgePluginUiServer {
17
17
  const user = payload.user;
18
18
  const passwd = payload.passwd;
19
19
  const language = payload.language;
20
+ const accountType = payload.accountType;
20
21
  const accountFile = `${this.homebridgeStoragePath}/melcloud/${accountName}_Account`;
21
22
  const buildingsFile = `${this.homebridgeStoragePath}/melcloud/${accountName}_Buildings`;
22
23
  const devicesFile = `${this.homebridgeStoragePath}/melcloud/${accountName}_Devices`;
23
- const melCloud = new MelCloud(user, passwd, language, accountFile, buildingsFile, devicesFile, false, true);
24
+ const melCloud = new MelCloud(accountType, user, passwd, language, accountFile, buildingsFile, devicesFile, false, true);
24
25
 
25
26
  try {
26
27
  const response = await melCloud.connect();
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.35",
4
+ "version": "4.0.0-beta.37",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",