homebridge-melcloud-control 4.1.2-beta.70 → 4.1.2-beta.71

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.
@@ -107,6 +107,7 @@
107
107
 
108
108
  const accounts = pluginConfig[0].accounts || [];
109
109
  const accountsCount = accounts.length;
110
+ this.accountIndex = 0;
110
111
 
111
112
  const container = document.getElementById("accountButton");
112
113
  container.style.display = 'flex';
@@ -130,7 +131,7 @@
130
131
 
131
132
  // Tworzenie przycisków
132
133
  accounts.forEach((account, i) => {
133
- this.account = account;
134
+ this.accountIndex = i;
134
135
 
135
136
  const button = document.createElement("button");
136
137
  button.type = "button";
@@ -141,7 +142,6 @@
141
142
  container.appendChild(button);
142
143
 
143
144
  button.addEventListener('click', async () => {
144
- this.account = account;
145
145
 
146
146
  // Zmieniamy klasę wszystkich przycisków
147
147
  accounts.forEach((_, j) => {
@@ -167,7 +167,7 @@
167
167
 
168
168
  // Jeden listener input dla całego formularza
169
169
  document.getElementById('configForm').addEventListener('input', async () => {
170
- const account = this.account;
170
+ const account = pluginConfig[0].accounts[this.accountIndex];
171
171
  if (!account) return;
172
172
 
173
173
  account.name = formElements.name.value;
@@ -239,7 +239,7 @@
239
239
  homebridge.showSpinner();
240
240
 
241
241
  try {
242
- const account = this.account;
242
+ const account = pluginConfig[0].accounts[this.accountIndex];
243
243
  const response = await homebridge.request('/connect', account);
244
244
  if (!response.State) {
245
245
  homebridge.hideSpinner();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.1.2-beta.70",
4
+ "version": "4.1.2-beta.71",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",