homebridge-melcloud-control 4.3.5-beta.16 → 4.3.5-beta.17
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 +1 -1
- package/package.json +1 -1
- package/src/deviceata.js +1 -1
- package/src/melcloudata.js +2 -7
- package/src/melcloudhome.js +3 -1
package/index.js
CHANGED
|
@@ -93,7 +93,7 @@ class MelCloudPlatform {
|
|
|
93
93
|
melcloud = new MelCloud(account, accountFile, buildingsFile, devicesFile, true);
|
|
94
94
|
break;
|
|
95
95
|
case 'melcloudhome':
|
|
96
|
-
timmers = [{ name: 'connect', sampling: 3300000 }, { name: 'checkDevicesList', sampling:
|
|
96
|
+
timmers = [{ name: 'connect', sampling: 3300000 }, { name: 'checkDevicesList', sampling: 3000 }];
|
|
97
97
|
melcloud = new MelCloudHome(account, accountFile, buildingsFile, devicesFile, true);
|
|
98
98
|
break;
|
|
99
99
|
default:
|
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.17",
|
|
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/deviceata.js
CHANGED
|
@@ -1878,7 +1878,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1878
1878
|
if (this.restFul.enable || this.mqtt.enable) await this.externalIntegrations();
|
|
1879
1879
|
|
|
1880
1880
|
//prepare accessory
|
|
1881
|
-
await new Promise(r => setTimeout(r,
|
|
1881
|
+
await new Promise(r => setTimeout(r, 5000));
|
|
1882
1882
|
const accessory = await this.prepareAccessory();
|
|
1883
1883
|
return accessory;
|
|
1884
1884
|
} catch (error) {
|
package/src/melcloudata.js
CHANGED
|
@@ -30,7 +30,6 @@ class MelCloudAta extends EventEmitter {
|
|
|
30
30
|
let deviceData = null;
|
|
31
31
|
melcloud.on('devicesList', async (devicesData) => {
|
|
32
32
|
this.headers = devicesData.Headers;
|
|
33
|
-
const webSocket = devicesData.WebSocket;
|
|
34
33
|
deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
|
|
35
34
|
if (!deviceData) return;
|
|
36
35
|
deviceData.Scenes = devicesData.Scenes ?? [];
|
|
@@ -38,12 +37,8 @@ class MelCloudAta extends EventEmitter {
|
|
|
38
37
|
//update state
|
|
39
38
|
await this.updateState(deviceData);
|
|
40
39
|
})
|
|
41
|
-
.on('
|
|
40
|
+
.on('webSocket', async (parsedMessage) => {
|
|
42
41
|
try {
|
|
43
|
-
const parsedMessage = JSON.parse(message);
|
|
44
|
-
const stringifyMessage = JSON.stringify(parsedMessage, null, 2);
|
|
45
|
-
if (parsedMessage.message === 'Forbidden') return;
|
|
46
|
-
|
|
47
42
|
const messageData = parsedMessage?.[0]?.Data;
|
|
48
43
|
if (!messageData || !deviceData) return;
|
|
49
44
|
|
|
@@ -97,7 +92,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
97
92
|
//update state
|
|
98
93
|
if (updateState) await this.updateState(deviceData);
|
|
99
94
|
} catch (error) {
|
|
100
|
-
if (this.logError) this.emit('error', `
|
|
95
|
+
if (this.logError) this.emit('error', `Web socket process message error: ${error}`);
|
|
101
96
|
}
|
|
102
97
|
});
|
|
103
98
|
}
|
package/src/melcloudhome.js
CHANGED
|
@@ -254,7 +254,9 @@ class MelCloudHome extends EventEmitter {
|
|
|
254
254
|
const parsedMessage = JSON.parse(message);
|
|
255
255
|
const stringifyMessage = JSON.stringify(parsedMessage, null, 2);
|
|
256
256
|
if (this.logDebug) this.emit('debug', `Incoming message: ${stringifyMessage}`);
|
|
257
|
-
|
|
257
|
+
if (parsedMessage.message === 'Forbidden') return;
|
|
258
|
+
|
|
259
|
+
this.emit('webSocket', parsedMessage);
|
|
258
260
|
});
|
|
259
261
|
} catch (error) {
|
|
260
262
|
if (this.logError) this.emit('error', `Socket connection failed: ${error}`);
|