homebridge-melcloud-control 4.0.0-beta.329 → 4.0.0-beta.330

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.329",
4
+ "version": "4.0.0-beta.330",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -145,12 +145,6 @@ class MelCloudHomeToken extends EventEmitter {
145
145
  validateStatus: status => [200, 302, 400].includes(status),
146
146
  });
147
147
 
148
- const cookie = response.headers['set-cookie'];
149
- if (cookie) {
150
- if (this.logWarn) this.emit('warn', `Cookie returned from login: ${cookie}`);
151
- return cookie;
152
- }
153
-
154
148
  if (response.status === 302 && response.headers.location) {
155
149
  // Login success — mamy redirect z "code="
156
150
  const redirectUrl = response.headers.location;
@@ -164,6 +158,8 @@ class MelCloudHomeToken extends EventEmitter {
164
158
  validateStatus: s => [200, 302].includes(s),
165
159
  });
166
160
 
161
+ if (this.logWarn) this.emit('warn', `Redirect URL: ${redirectUrl}`);
162
+
167
163
  const finalCookies = finalResp.headers['set-cookie'] || [];
168
164
  const c1 = finalCookies.find(c => c.startsWith('__Secure-monitorandcontrolC1='))?.split(';')[0];
169
165
  const c2 = finalCookies.find(c => c.startsWith('__Secure-monitorandcontrolC2='))?.split(';')[0];