homebridge-melcloud-control 4.0.0-beta.262 → 4.0.0-beta.263

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 +13 -3
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.262",
4
+ "version": "4.0.0-beta.263",
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
@@ -292,10 +292,20 @@ class MelCloud extends EventEmitter {
292
292
  await page.goto(ApiUrlsHome.BaseURL, { waitUntil: 'networkidle2' });
293
293
 
294
294
  // Kliknięcie przycisku logowania
295
- const loginBtn = await page.$x("//button[contains(text(),'Log In') or contains(text(),'Zaloguj')]");
296
- if (loginBtn.length === 0) throw new Error('Login button not found');
295
+ const buttons = await page.$$('button.btn--blue');
296
+ let loginBtn = null;
297
+
298
+ for (const btn of buttons) {
299
+ const text = await page.evaluate(el => el.textContent, btn);
300
+ if (text.trim() === 'Zaloguj' || text.trim() === 'Log In') {
301
+ loginBtn = btn;
302
+ break;
303
+ }
304
+ }
305
+
306
+ if (!loginBtn) throw new Error('Login button not found');
297
307
  await Promise.all([
298
- loginBtn[0].click(),
308
+ loginBtn.click(),
299
309
  page.waitForNavigation({ waitUntil: 'networkidle2' })
300
310
  ]);
301
311