homebridge-melcloud-control 4.0.0-beta.371 → 4.0.0-beta.372

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.371",
4
+ "version": "4.0.0-beta.372",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -1,7 +1,5 @@
1
1
  import axios from 'axios';
2
2
  import crypto from 'crypto';
3
- import { wrapper } from 'axios-cookiejar-support';
4
- import { CookieJar } from 'tough-cookie';
5
3
  import { JSDOM } from 'jsdom';
6
4
  import EventEmitter from 'events';
7
5
 
@@ -19,9 +17,7 @@ class MelCloudHomeToken extends EventEmitter {
19
17
  this.passwd = config.passwd;
20
18
  this.logWarn = config.logWarn;
21
19
  this.logError = config.logError;
22
-
23
- const jar = new CookieJar();
24
- this.axiosInstance = wrapper(axios.create({ jar, withCredentials: true }));
20
+ this.axiosInstance = axios.create({ headers: { 'User-Agent': MOBILE_USER_AGENT } });
25
21
  }
26
22
 
27
23
  generatePKCE() {
@@ -101,7 +97,7 @@ class MelCloudHomeToken extends EventEmitter {
101
97
  baseURL: TOKEN_ENDPOINT,
102
98
  headers: {
103
99
  'Content-Type': 'application/x-www-form-urlencoded',
104
-
100
+ 'Content-Length': tokenData.toString().length,
105
101
  'Authorization': 'Basic aG9tZW1vYmlsZTo=',
106
102
  },
107
103
  });
@@ -121,7 +117,6 @@ class MelCloudHomeToken extends EventEmitter {
121
117
  method: 'GET',
122
118
  baseURL: url,
123
119
  headers: {
124
- 'User-Agent': MOBILE_USER_AGENT,
125
120
  'Accept': 'text/html',
126
121
  },
127
122
  withCredentials: true,
@@ -149,7 +144,6 @@ class MelCloudHomeToken extends EventEmitter {
149
144
  method: 'POST',
150
145
  baseURL: url,
151
146
  headers: {
152
- 'User-Agent': MOBILE_USER_AGENT,
153
147
  'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
154
148
  'Accept-Language': 'en-US,en;q=0.9',
155
149
  'Content-Type': 'application/x-www-form-urlencoded',