homebridge-melcloud-control 4.0.0-beta.383 → 4.0.0-beta.384

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.
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.383",
4
+ "version": "4.0.0-beta.384",
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
@@ -277,7 +277,7 @@ class MelCloud extends EventEmitter {
277
277
  }
278
278
  }
279
279
 
280
- async connectToMelCloudHome1() {
280
+ async connectToMelCloudHome() {
281
281
  try {
282
282
  const melCloudHomeToken = new MelCloudHomeToken({
283
283
  user: this.user,
@@ -305,7 +305,7 @@ class MelCloud extends EventEmitter {
305
305
  }
306
306
  }
307
307
 
308
- async connectToMelCloudHome(refresh = false) {
308
+ async connectToMelCloudHome1(refresh = false) {
309
309
  if (this.logDebug) this.emit('debug', `Connecting to MELCloud Home`);
310
310
 
311
311
  let browser;
@@ -7,7 +7,7 @@ import EventEmitter from 'events';
7
7
 
8
8
  const MOBILE_USER_AGENT = 'MonitorAndControl.App.Mobile/35 CFNetwork/3860.100.1 Darwin/25.0.0';
9
9
  const CLIENT_ID = 'homemobile';
10
- const REDIRECT_URI = 'melcloudhome://';
10
+ const REDIRECT_URI = 'https://auth.melcloudhome.com/signin-oidc-meu';
11
11
  const SCOPE = 'openid profile email offline_access IdentityServerApi';
12
12
  const TOKEN_ENDPOINT = 'https://auth.melcloudhome.com/connect/token';
13
13
  const AUTHORIZE_ENDPOINT = 'https://auth.melcloudhome.com/connect/authorize';
@@ -44,7 +44,7 @@ class MelCloudHomeToken extends EventEmitter {
44
44
  try {
45
45
  const tokenData = new URLSearchParams({
46
46
  grant_type: 'authorization_code',
47
- code: this.code,
47
+ code: code,
48
48
  redirect_uri: REDIRECT_URI,
49
49
  client_id: CLIENT_ID,
50
50
  code_verifier: codeVerifier,
@@ -115,7 +115,6 @@ class MelCloudHomeToken extends EventEmitter {
115
115
  if (match) {
116
116
  const code = match[1];
117
117
  if (this.logWarn) this.emit('warn', `Redirect URL found code: ${code}`);
118
- this.code = code
119
118
  return code;
120
119
  } else {
121
120
  if (this.logWarn) this.emit('warn', `Redirect URL found, but no "code=" param: ${redirectUrl}`);