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.
- package/homebridge-ui/server.js +6 -4
- package/package.json +1 -1
package/homebridge-ui/server.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
-
|
|
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 ${
|
|
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();
|