homebridge-melcloud-control 4.3.0-beta.27 → 4.3.0-beta.28

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.3.0-beta.27",
4
+ "version": "4.3.0-beta.28",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -80,12 +80,12 @@ class MelCloudAta extends EventEmitter {
80
80
  }, delay);
81
81
  };
82
82
 
83
- async connectSocket(deviceData) {
83
+ async connectSocket(deviceData, wsHeaders) {
84
84
  if (this.connecting || this.socketConnected) return;
85
85
 
86
86
  this.connecting = true;
87
87
  try {
88
- const socket = new WebSocket(`ApiUrlsHome.WebSocketURL${deviceData.WsHeaders.hash}`, { headers: deviceData.WsHeaders.headers })
88
+ const socket = new WebSocket(`ApiUrlsHome.WebSocketURL${wsHeaders.hash}`, { headers: wsHeaders.headers })
89
89
  .on('error', (err) => {
90
90
  if (this.logDebug) this.emit('debug', `Socket error: ${err}`);
91
91
  })
@@ -159,7 +159,7 @@ class MelCloudAta extends EventEmitter {
159
159
  deviceData.Device.DefaultHeatingSetTemperature = temps?.defaultHeatingSetTemperature ?? 20;
160
160
  deviceData.Device.DefaultCoolingSetTemperature = temps?.defaultCoolingSetTemperature ?? 24;
161
161
 
162
- await this.connectSocket(deviceData);
162
+ await this.connectSocket(deviceData, devicesData.WsHeaders);
163
163
  }
164
164
  if (this.logDebug) this.emit('debug', `Device Data: ${JSON.stringify(deviceData, null, 2)}`);
165
165