homebridge-midea-platform 0.4.4 → 0.4.5

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.
@@ -87,7 +87,8 @@ class UiServer extends HomebridgePluginUiServer {
87
87
  await this.cloud.login();
88
88
  } catch (e) {
89
89
  const msg = e instanceof Error ? e.stack : e;
90
- throw new RequestError(`Login failed:\n${msg}`);
90
+ this.logger.warn(`Login failed:\n${msg}`);
91
+ throw new RequestError('Login failed, check credentials.');
91
92
  }
92
93
  });
93
94
 
@@ -98,7 +99,7 @@ class UiServer extends HomebridgePluginUiServer {
98
99
  });
99
100
  this.config = config;
100
101
  this.logger.setDebugEnabled(config.uiDebug ? config.uiDebug : false);
101
- this.logger.debug(`Merged config: ${JSON.stringify(config, null, 2)}`);
102
+ this.logger.debug(`Merged config:\n${JSON.stringify(config, null, 2)}`);
102
103
  return config;
103
104
  });
104
105
 
@@ -179,12 +180,13 @@ class UiServer extends HomebridgePluginUiServer {
179
180
  const response = await this.promiseSocket.read();
180
181
  if (response) {
181
182
  if (response.length < 20) {
182
- throw Error(`[${device.name}] Authenticate error when receiving data from ${this.ip}:${this.port}. (Data length mismatch)`);
183
+ this.logger.debug(`[${device.name}] Authenticate error when receiving data from ${device.ip}:${device.port}. (Data length: ${response.length})\n${JSON.stringify(response)}`);
184
+ throw Error(`[${device.name}] Authenticate error when receiving data from ${device.ip}:${device.port}. (Data length mismatch)`);
183
185
  }
184
186
  const resp = response.subarray(8, 72);
185
187
  this.security.tcp_key_from_resp(resp, Buffer.from(device.key, 'hex'));
186
188
  } else {
187
- throw Error(`[${device.name}] Authenticate error when receiving data from ${this.ip}:${this.port}.`);
189
+ throw Error(`[${device.name}] Authenticate error when receiving data from ${device.ip}:${device.port}.`);
188
190
  }
189
191
  } finally {
190
192
  this.promiseSocket.destroy();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Homebridge Midea Platform",
3
3
  "name": "homebridge-midea-platform",
4
- "version": "0.4.4",
4
+ "version": "0.4.5",
5
5
  "description": "Homebridge plugin for Midea devices",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {