homebridge-melcloud-control 4.0.0-beta.320 → 4.0.0-beta.322

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.320",
4
+ "version": "4.0.0-beta.322",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -87,9 +87,9 @@ class MelCloudHomeToken extends EventEmitter {
87
87
  try {
88
88
  const tokenResponse = await axios.post(TOKEN_ENDPOINT, new URLSearchParams({
89
89
  grant_type: 'authorization_code',
90
- client_id: this.clientId,
90
+ client_id: CLIENT_ID,
91
91
  code: code,
92
- redirect_uri: this.redirectUri
92
+ redirect_uri: REDIRECT_URI
93
93
  }).toString(), {
94
94
  headers: {
95
95
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -110,7 +110,7 @@ class MelCloudHomeToken extends EventEmitter {
110
110
  // Step 1: Pobierz stronę logowania, żeby uzyskać sesję + token _csrf
111
111
  const getResp = await axios.get(url, {
112
112
  headers: {
113
- 'User-Agent': 'Mozilla/5.0',
113
+ 'User-Agent': MOBILE_USER_AGENT,
114
114
  'Accept': 'text/html',
115
115
  },
116
116
  withCredentials: true,
@@ -157,7 +157,7 @@ class MelCloudHomeToken extends EventEmitter {
157
157
  'Cookie': cookies.join('; '),
158
158
  'Origin': 'https://auth.melcloudhome.com',
159
159
  'Referer': url,
160
- 'User-Agent': 'Mozilla/5.0',
160
+ 'User-Agent': MOBILE_USER_AGENT
161
161
  },
162
162
  maxRedirects: 0,
163
163
  validateStatus: status => [200, 302, 400].includes(status),