homebridge-melcloud-control 4.0.0-beta.272 → 4.0.0-beta.273

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 +2 -20
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.272",
4
+ "version": "4.0.0-beta.273",
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
@@ -296,29 +296,11 @@ class MelCloud extends EventEmitter {
296
296
  const page = await browser.newPage();
297
297
  await page.goto(url, { waitUntil: 'networkidle2' });
298
298
 
299
- const buttons = await page.$$('button.btn--blue');
300
- let loginBtn = null;
301
-
302
- for (const btn of buttons) {
303
- const text = await page.evaluate(el => el.textContent, btn);
304
- if (text.trim() === 'Zaloguj' || text.trim() === 'Log In') {
305
- loginBtn = btn;
306
- break;
307
- }
308
- }
309
-
310
- if (!loginBtn && this.logWarn) this.emit('warn', `Login button not found`);
311
-
312
- await Promise.all([
313
- loginBtn.click(),
314
- page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 10000 })
315
- ]);
316
-
317
299
  await page.waitForSelector('input[name="username"]', { timeout: 5000 });
318
300
  await page.type('input[name="username"]', this.user, { delay: 50 });
319
301
  await page.type('input[name="password"]', this.passwd, { delay: 50 });
320
302
 
321
- const button1 = await page.$('input[type="submit"]');
303
+ const button1 = await page.$('input[type="Submit"]');
322
304
  await Promise.all([
323
305
  button1.click(),
324
306
  page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 10000 })
@@ -374,7 +356,7 @@ class MelCloud extends EventEmitter {
374
356
 
375
357
  for (const btn of buttons) {
376
358
  const text = await page.evaluate(el => el.textContent, btn);
377
- if (text.trim() === 'Zaloguj' || text.trim() === 'Log In') {
359
+ if (text.trim() === 'Zaloguj' || text.trim() === 'Sign In') {
378
360
  loginBtn = btn;
379
361
  break;
380
362
  }