homebridge-melcloud-control 4.0.0-beta.309 → 4.0.0-beta.310

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.309",
4
+ "version": "4.0.0-beta.310",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -16,9 +16,9 @@ class MelCloudHomeToken extends EventEmitter {
16
16
  super();
17
17
  this.user = config.user;
18
18
  this.passwd = config.passwd;
19
- this.serialNumber = config.serialNumber;
20
19
  this.logWarn = config.logWarn;
21
20
  this.logError = config.logError;
21
+
22
22
  const jar = new CookieJar();
23
23
  this.client = wrapper(axios.create({ jar, withCredentials: true }));
24
24
  this.client.defaults.headers['User-Agent'] = MOBILE_USER_AGENT;
@@ -138,8 +138,8 @@ class MelCloudHomeToken extends EventEmitter {
138
138
  async loginToMelCloudHome(url) {
139
139
  try {
140
140
  const form = new URLSearchParams();
141
- form.append('user[email]', this.user);
142
- form.append('user[password]', this.passwd);
141
+ form.append('username[email]', this.user);
142
+ form.append('password[password]', this.passwd);
143
143
 
144
144
  const response = await axios({
145
145
  method: 'POST',
@@ -166,7 +166,7 @@ class MelCloudHomeToken extends EventEmitter {
166
166
 
167
167
  return cookie;
168
168
  } catch (error) {
169
- throw new Error(`Login to Enlighten error: ${error}`);
169
+ throw new Error(`Login to MELCloud Home error: ${error}`);
170
170
  }
171
171
  }
172
172
  }