homebridge-midea-platform 1.2.6-beta.3 → 1.2.6-beta.4

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.
@@ -99,6 +99,7 @@ class Logger {
99
99
  */
100
100
  class UiServer extends HomebridgePluginUiServer {
101
101
  cloud;
102
+ smartHomeCloud;
102
103
  promiseSocket;
103
104
  security;
104
105
  logger;
@@ -193,11 +194,7 @@ class UiServer extends HomebridgePluginUiServer {
193
194
 
194
195
  this.onRequest("/downloadLua", async ({ deviceType, deviceSn }) => {
195
196
  try {
196
- if (!this.cloud || !this.cloud.isProxied()) {
197
- this.pushEvent("showToast", {
198
- success: true,
199
- msg: "Currently used cloud provider doesn't support Lua downloading, using the default profile now...",
200
- });
197
+ if (!this.smartHomeCloud) {
201
198
  const username = Buffer.from(
202
199
  (DEFAULT_SMARTHOME_ACCOUNT[0] ^ DEFAULT_SMARTHOME_ACCOUNT[1]).toString(16),
203
200
  "hex",
@@ -206,14 +203,14 @@ class UiServer extends HomebridgePluginUiServer {
206
203
  (DEFAULT_SMARTHOME_ACCOUNT[0] ^ DEFAULT_SMARTHOME_ACCOUNT[2]).toString(16),
207
204
  "hex",
208
205
  ).toString("ascii");
209
- this.cloud = CloudFactory.createCloud(
206
+ this.smartHomeCloud = CloudFactory.createCloud(
210
207
  username,
211
208
  password,
212
209
  "Midea SmartHome (MSmartHome)",
213
210
  );
214
- await this.cloud.login();
211
+ await this.smartHomeCloud.login();
215
212
  }
216
- const lua = await this.cloud.getProtocolLua(deviceType, deviceSn);
213
+ const lua = await this.smartHomeCloud.getProtocolLua(deviceType, deviceSn);
217
214
  return lua;
218
215
  } catch (e) {
219
216
  const msg = e instanceof Error ? e.stack : e;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "displayName": "Homebridge Midea Platform",
3
3
  "name": "homebridge-midea-platform",
4
4
  "type": "module",
5
- "version": "1.2.6-beta.3",
5
+ "version": "1.2.6-beta.4",
6
6
  "description": "Homebridge plugin for Midea devices",
7
7
  "license": "Apache-2.0",
8
8
  "repository": {