homebridge-melcloud-control 3.9.0-beta.6 → 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.
@@ -20,9 +20,9 @@
20
20
  <form id="configForm">
21
21
  <div class="text-center">
22
22
  <label id="accountName" class="fw-bold" style="font-size: 23px;">Account</label><br>
23
- <label id="info" class="d-block" style="font-size: 17px;"></label>
24
- <label id="info1" class="d-block" style="font-size: 15px;"></label>
25
- <label id="info2" class="d-block" style="font-size: 15px;"></label>
23
+ <label id="info" class="d-block" style="font-size: 16px;"></label>
24
+ <label id="info1" class="d-block" style="font-size: 14px;"></label>
25
+ <label id="info2" class="d-block" style="font-size: 14px;"></label>
26
26
  </div>
27
27
 
28
28
  <div class="mb-3">
@@ -35,15 +35,45 @@
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">
44
50
  <label for="language" class="form-label">Language</label>
45
51
  <select id="language" name="language" class="form-control">
46
- <!-- languages options omitted for brevity -->
52
+ <option value="0">English</option>
53
+ <option value="1">Български</option>
54
+ <option value="2">Čeština</option>
55
+ <option value="3">Dansk</option>
56
+ <option value="4">Deutsch</option>
57
+ <option value="5">Eesti</option>
58
+ <option value="6">Español</option>
59
+ <option value="7">Français</option>
60
+ <option value="8">Հայերեն</option>
61
+ <option value="9">Latviešu</option>
62
+ <option value="10">Lietuvių</option>
63
+ <option value="11">Magyar</option>
64
+ <option value="12">Nederlands</option>
65
+ <option value="13">Norwegian</option>
66
+ <option value="14">Polski</option>
67
+ <option value="15">Português</option>
68
+ <option value="16">Русский</option>
69
+ <option value="17">Suomi</option>
70
+ <option value="18">Svenska</option>
71
+ <option value="19">Українська</option>
72
+ <option value="20">Türkçe</option>
73
+ <option value="21">Ελληνικά</option>
74
+ <option value="22">Hrvatski</option>
75
+ <option value="23">Română</option>
76
+ <option value="24">Slovenščina</option>
47
77
  </select>
48
78
  </div>
49
79
 
@@ -148,9 +178,28 @@
148
178
  }
149
179
  }
150
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
+
151
194
  document.getElementById('logIn').addEventListener('click', async () => {
152
195
  homebridge.showSpinner();
153
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
+
154
203
  updateInfo('info', 'Connecting...', 'yellow');
155
204
 
156
205
  try {
@@ -311,8 +360,8 @@
311
360
  homebridge.hideSpinner();
312
361
 
313
362
  } catch (error) {
314
- updateInfo('info', 'Check Your credentials data and try again.', 'yellow');
315
- updateInfo('info1', `Error: ${error}`, 'red');
363
+ updateInfo('info', 'Check your credentials and try again.', 'yellow');
364
+ updateInfo('info1', `Error: ${error?.message || 'Unknown error'}`, 'red');
316
365
  document.getElementById('logIn').setAttribute('class', 'btn btn-secondary');
317
366
  } finally {
318
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.6",
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",