homebridge-melcloud-control 4.3.5-beta.20 → 4.3.5-beta.22
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/index.js +9 -9
- package/package.json +1 -1
- package/src/melcloudata.js +2 -2
package/index.js
CHANGED
|
@@ -120,18 +120,18 @@ class MelCloudPlatform {
|
|
|
120
120
|
if (logLevel.success) log.success(`${accountName}, ${accountInfo.Info}`);
|
|
121
121
|
|
|
122
122
|
//check devices list
|
|
123
|
-
let
|
|
123
|
+
let devicesList;
|
|
124
124
|
try {
|
|
125
|
-
|
|
126
|
-
if (!
|
|
127
|
-
if (logLevel.warn) log.warn(`${accountName}, ${
|
|
125
|
+
devicesList = await melcloud.checkDevicesList();
|
|
126
|
+
if (!devicesList.State) {
|
|
127
|
+
if (logLevel.warn) log.warn(`${accountName}, ${devicesList.Info}`);
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
130
|
} catch (error) {
|
|
131
131
|
if (logLevel.error) log.error(`${accountName}, Check devices list error: ${error.message ?? error}`);
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
|
-
if (logLevel.debug) log.info(
|
|
134
|
+
if (logLevel.debug) log.info(devicesList.Info);
|
|
135
135
|
|
|
136
136
|
//start account impulse generator
|
|
137
137
|
await melcloud.impulseGenerator.state(true, timmers, false);
|
|
@@ -146,7 +146,7 @@ class MelCloudPlatform {
|
|
|
146
146
|
for (const [index, device] of devices.entries()) {
|
|
147
147
|
//chack device from config exist on melcloud
|
|
148
148
|
const displayType = device.displayType > 0;
|
|
149
|
-
const deviceExistInMelCloud =
|
|
149
|
+
const deviceExistInMelCloud = devicesList.Devices.some(dev => dev.DeviceID === device.id);
|
|
150
150
|
if (!deviceExistInMelCloud || !displayType) continue;
|
|
151
151
|
|
|
152
152
|
device.id = String(device.id);
|
|
@@ -180,15 +180,15 @@ class MelCloudPlatform {
|
|
|
180
180
|
let configuredDevice;
|
|
181
181
|
switch (deviceType) {
|
|
182
182
|
case 0: //ATA
|
|
183
|
-
configuredDevice = new DeviceAta(api, account, device, defaultTempsFile, accountInfo, accountFile, melcloud
|
|
183
|
+
configuredDevice = new DeviceAta(api, account, device, defaultTempsFile, accountInfo, accountFile, melcloud);
|
|
184
184
|
break;
|
|
185
185
|
case 1: //ATW
|
|
186
|
-
configuredDevice = new DeviceAtw(api, account, device, defaultTempsFile, accountInfo, accountFile, melcloud
|
|
186
|
+
configuredDevice = new DeviceAtw(api, account, device, defaultTempsFile, accountInfo, accountFile, melcloud);
|
|
187
187
|
break;
|
|
188
188
|
case 2:
|
|
189
189
|
break;
|
|
190
190
|
case 3: //ERV
|
|
191
|
-
configuredDevice = new DeviceErv(api, account, device, defaultTempsFile, accountInfo, accountFile, melcloud
|
|
191
|
+
configuredDevice = new DeviceErv(api, account, device, defaultTempsFile, accountInfo, accountFile, melcloud);
|
|
192
192
|
break;
|
|
193
193
|
default:
|
|
194
194
|
if (logLevel.warn) log.warn(`${accountName}, ${deviceTypeString}, ${deviceName}, unknown device: ${deviceType}.`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.3.5-beta.
|
|
4
|
+
"version": "4.3.5-beta.22",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
package/src/melcloudata.js
CHANGED
|
@@ -25,8 +25,6 @@ class MelCloudAta extends EventEmitter {
|
|
|
25
25
|
this.deviceData = {};
|
|
26
26
|
this.headers = {};
|
|
27
27
|
|
|
28
|
-
if (!this.logDebug) this.emit('debug', `MELCloud: ${melcloud}`);
|
|
29
|
-
|
|
30
28
|
let deviceData = null;
|
|
31
29
|
melcloud.on('devicesList', async (devicesData) => {
|
|
32
30
|
this.headers = devicesData.Headers;
|
|
@@ -34,6 +32,8 @@ class MelCloudAta extends EventEmitter {
|
|
|
34
32
|
if (!deviceData) return;
|
|
35
33
|
deviceData.Scenes = devicesData.Scenes ?? [];
|
|
36
34
|
|
|
35
|
+
if (!this.logDebug) this.emit('debug', `MELCloud: ${JSON.stringify(melcloud.Devices, null, 2)}`);
|
|
36
|
+
|
|
37
37
|
//update state
|
|
38
38
|
await this.updateState(deviceData);
|
|
39
39
|
}).on('webSocket', async (parsedMessage) => {
|