homebridge-melcloud-control 4.0.0-beta.314 → 4.0.0-beta.316
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 -4
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.316",
|
|
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
|
@@ -163,7 +163,7 @@ class MelCloudHomeToken extends EventEmitter {
|
|
|
163
163
|
form.append('_csrf', csrf);
|
|
164
164
|
|
|
165
165
|
// Step 3: Wyślij POST z danymi logowania
|
|
166
|
-
const
|
|
166
|
+
const response = await axios.post(url, form.toString(), {
|
|
167
167
|
headers: {
|
|
168
168
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
169
169
|
'Cookie': cookies.join('; '),
|
|
@@ -175,16 +175,16 @@ class MelCloudHomeToken extends EventEmitter {
|
|
|
175
175
|
validateStatus: status => [200, 302, 400].includes(status),
|
|
176
176
|
});
|
|
177
177
|
|
|
178
|
-
this.emit('warn', `No cookie returned from login. Response headers: ${
|
|
178
|
+
this.emit('warn', `No cookie returned from login. Response headers: ${response}`);
|
|
179
179
|
|
|
180
180
|
if (response.status !== 200) {
|
|
181
|
-
if (this.logError) this.emit('error', `Login failed with status code: ${
|
|
181
|
+
if (this.logError) this.emit('error', `Login failed with status code: ${response.status}`);
|
|
182
182
|
return null;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
const cookie = response.headers['set-cookie'];
|
|
186
186
|
if (!cookie) {
|
|
187
|
-
if (this.logWarn) this.emit('warn', `No cookie returned from login. Response headers: ${JSON.stringify(
|
|
187
|
+
if (this.logWarn) this.emit('warn', `No cookie returned from login. Response headers: ${JSON.stringify(response.headers)}`);
|
|
188
188
|
return null;
|
|
189
189
|
}
|
|
190
190
|
|