homebridge-melcloud-control 3.9.0-beta.7 → 3.9.0-beta.8

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.
@@ -35,9 +35,15 @@
35
35
  <input id="user" type="text" class="form-control" required>
36
36
  </div>
37
37
 
38
- <div class="mb-3">
38
+ <!-- Password field with toggle -->
39
+ <div class="mb-3 position-relative">
39
40
  <label for="passwd" class="form-label">Password</label>
40
- <input id="passwd" type="password" class="form-control" autocomplete="off" required>
41
+ <div class="input-group">
42
+ <input id="passwd" type="password" class="form-control" autocomplete="off" required>
43
+ <button type="button" id="togglePasswd" class="btn btn-outline-secondary">
44
+ <i class="fas fa-eye"></i>
45
+ </button>
46
+ </div>
41
47
  </div>
42
48
 
43
49
  <div class="mb-3">
@@ -172,9 +178,28 @@
172
178
  }
173
179
  }
174
180
 
181
+ // === Password toggle ===
182
+ document.getElementById('togglePasswd').addEventListener('click', () => {
183
+ const passwdInput = document.getElementById('passwd');
184
+ const icon = document.querySelector('#togglePasswd i');
185
+ if (passwdInput.type === 'password') {
186
+ passwdInput.type = 'text';
187
+ icon.classList.replace('fa-eye', 'fa-eye-slash');
188
+ } else {
189
+ passwdInput.type = 'password';
190
+ icon.classList.replace('fa-eye-slash', 'fa-eye');
191
+ }
192
+ });
193
+
175
194
  document.getElementById('logIn').addEventListener('click', async () => {
176
195
  homebridge.showSpinner();
177
196
  document.getElementById(`logIn`).setAttribute("class", "btn btn-primary");
197
+
198
+ // Reset feedback before each login attempt
199
+ updateInfo('info', '', '');
200
+ updateInfo('info1', '', '');
201
+ updateInfo('info2', '', '');
202
+
178
203
  updateInfo('info', 'Connecting...', 'yellow');
179
204
 
180
205
  try {
@@ -335,8 +360,8 @@
335
360
  homebridge.hideSpinner();
336
361
 
337
362
  } catch (error) {
338
- updateInfo('info', 'Check Your credentials data and try again.', 'yellow');
339
- updateInfo('info1', `Error: ${error}`, 'red');
363
+ updateInfo('info', 'Check your credentials and try again.', 'yellow');
364
+ updateInfo('info1', `Error: ${error?.message || 'Unknown error'}`, 'red');
340
365
  document.getElementById('logIn').setAttribute('class', 'btn btn-secondary');
341
366
  } finally {
342
367
  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": "3.9.0-beta.7",
4
+ "version": "3.9.0-beta.8",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",