homebridge-melcloud-control 4.0.0-beta.18 → 4.0.0-beta.19

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/melcloud.js +10 -2
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.18",
4
+ "version": "4.0.0-beta.19",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/melcloud.js CHANGED
@@ -222,6 +222,14 @@ class MelCloud extends EventEmitter {
222
222
  this.emit('warn', 'Opening login page...');
223
223
  await page.goto(loginUrl, { waitUntil: 'networkidle2' });
224
224
 
225
+ // Kliknij przycisk logowania
226
+ const loginBtn = await page.$('a[href*="login"], button:has-text("Zaloguj"), button:has-text("Sign in")');
227
+ if (!loginBtn) throw new Error('Login button not found on homepage');
228
+ await Promise.all([
229
+ loginBtn.click(),
230
+ page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 20000 })
231
+ ]);
232
+
225
233
  // Poczekaj, aż strona przekieruje do Cognito login
226
234
  await page.waitForSelector('input[name="username"]', { timeout: 15000 });
227
235
 
@@ -230,9 +238,9 @@ class MelCloud extends EventEmitter {
230
238
  await page.type('input[name="password"]', this.passwd, { delay: 50 });
231
239
 
232
240
  // Kliknij przycisk logowania
233
- const button = await page.$('input[type="submit"]');
241
+ const button1 = await page.$('input[type="submit"]');
234
242
  await Promise.all([
235
- button.click(),
243
+ button1.click(),
236
244
  page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 20000 })
237
245
  ]);
238
246