homebridge-melcloud-control 4.0.0-beta.363 → 4.0.0-beta.364
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 +1 -1
- package/src/melcloudhometoken.js +4 -1
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.
|
|
4
|
+
"version": "4.0.0-beta.364",
|
|
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/melcloudhometoken.js
CHANGED
|
@@ -151,13 +151,16 @@ class MelCloudHomeToken extends EventEmitter {
|
|
|
151
151
|
validateStatus: status => [200, 302, 400].includes(status),
|
|
152
152
|
});
|
|
153
153
|
|
|
154
|
+
if (this.logWarn) this.emit('warn', `Redirect: ${cookies}`);
|
|
155
|
+
return cookies;
|
|
156
|
+
|
|
154
157
|
|
|
155
158
|
if (response.status === 302 && response.headers.location) {
|
|
156
159
|
// Login success — mamy redirect z "code="
|
|
157
160
|
const redirectUrl = response.headers.location;
|
|
158
161
|
if (this.logWarn) this.emit('warn', `Redirect URL: ${redirectUrl}`);
|
|
159
162
|
|
|
160
|
-
const getResp = await this.client.get('https://melcloudhome.com/
|
|
163
|
+
const getResp = await this.client.get('https://melcloudhome.com/ws/token', {
|
|
161
164
|
headers: {
|
|
162
165
|
'Accept': 'text/html',
|
|
163
166
|
},
|