homebridge-melcloud-control 2.5.0-beta.12 → 2.5.0-beta.13
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 +39 -44
- package/package.json +1 -1
package/homebridge-ui/server.js
CHANGED
|
@@ -24,53 +24,48 @@ class PluginUiServer extends HomebridgePluginUiServer {
|
|
|
24
24
|
const accountInfoFile = `${this.homebridgeStoragePath}/melcloud/${accountName}_Account`;
|
|
25
25
|
const deviceInfoFile = `${this.homebridgeStoragePath}/melcloud/${accountName}_Device_`;
|
|
26
26
|
const buildingsFile = `${this.homebridgeStoragePath}/melcloud/${accountName}_Buildings`;
|
|
27
|
-
let data = {};
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
let data = {};
|
|
29
|
+
const melCloud = new MelCloud(user, passwd, language, accountInfoFile, deviceInfoFile, buildingsFile, enableDebugMode, refreshInterval, true);
|
|
30
|
+
melCloud.on('devicesList', (devices) => {
|
|
31
|
+
data = {
|
|
32
|
+
info: 'Check devices list complete.',
|
|
33
|
+
status: 0,
|
|
34
|
+
data: devices
|
|
35
|
+
};
|
|
36
|
+
})
|
|
37
|
+
.on('success', (message) => {
|
|
38
|
+
data = {
|
|
39
|
+
info: message,
|
|
40
|
+
status: 1
|
|
36
41
|
};
|
|
37
42
|
})
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
info: error,
|
|
65
|
-
status: 5
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
} catch (error) {
|
|
69
|
-
return data = {
|
|
70
|
-
info: error,
|
|
71
|
-
status: 5
|
|
72
|
-
};
|
|
73
|
-
};
|
|
43
|
+
.on('message', (message) => {
|
|
44
|
+
data = {
|
|
45
|
+
info: message,
|
|
46
|
+
status: 2
|
|
47
|
+
};
|
|
48
|
+
})
|
|
49
|
+
.on('debug', (debug) => {
|
|
50
|
+
data = {
|
|
51
|
+
info: debug,
|
|
52
|
+
status: 3
|
|
53
|
+
};
|
|
54
|
+
})
|
|
55
|
+
.on('warn', (warn) => {
|
|
56
|
+
data = {
|
|
57
|
+
info: warn,
|
|
58
|
+
status: 4
|
|
59
|
+
};
|
|
60
|
+
})
|
|
61
|
+
.on('error', async (error) => {
|
|
62
|
+
data = {
|
|
63
|
+
info: error,
|
|
64
|
+
status: 5
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return data;
|
|
74
69
|
};
|
|
75
70
|
};
|
|
76
71
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "2.5.0-beta.
|
|
4
|
+
"version": "2.5.0-beta.13",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|