homebridge-melcloud-control 4.0.0-beta.76 → 4.0.0-beta.78

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.
@@ -86,7 +86,7 @@
86
86
  </div>
87
87
 
88
88
  <div class="text-center">
89
- <button id="logIn" type="button" class="btn btn-secondary">Log In</button>
89
+ <button id="logIn" type="button" class="btn btn-secondary">Connect to MELCloud</button>
90
90
  <button id="configButton" type="button" class="btn btn-secondary"><i class="fas fa-gear"></i></button>
91
91
  </div>
92
92
  </form>
@@ -146,8 +146,8 @@
146
146
 
147
147
  document.getElementById('logIn').disabled = !(acc.name && acc.user && acc.passwd && acc.languaged && acc.displayType);
148
148
 
149
- await homebridge.updatePluginConfig(pluginConfig);
150
- await homebridge.savePluginConfig(pluginConfig);
149
+ await homebridge.updatePluginConfig(acc);
150
+ await homebridge.savePluginConfig(acc);
151
151
  });
152
152
 
153
153
  // --- Config Button Toggle ---
@@ -176,9 +176,12 @@
176
176
  function removeStaleDevices(configDevices, melcloudDevices) {
177
177
  const melcloudIds = melcloudDevices.map(d => d.DeviceID);
178
178
  const removedDevices = [];
179
+ const acc = pluginConfig[0].accounts[this.accountIndex];
180
+
179
181
  for (let i = configDevices.length - 1; i >= 0; i--) {
180
182
  const device = configDevices[i];
181
- if (device.id !== 0 && !melcloudIds.includes(device.id)) {
183
+ const deviceId = acc.displayType === 'melcloud' ? parseInt(device.id) : device.id;
184
+ if (deviceId !== 0 && !melcloudIds.includes(deviceId)) {
182
185
  removedDevices.push(device);
183
186
  configDevices.splice(i, 1);
184
187
  }
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.76",
4
+ "version": "4.0.0-beta.78",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",