homebridge-melcloud-control 4.2.5-beta.32 → 4.2.5-beta.33

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.2.5-beta.32",
4
+ "version": "4.2.5-beta.33",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -97,8 +97,10 @@ class MelCloudAta extends EventEmitter {
97
97
  //display info if units are not configured in MELCloud service
98
98
  if (unitsCount === 0 && this.logDebug) if (this.logDebug) this.emit('debug', `Units are not configured in MELCloud service`);
99
99
 
100
- //restFul
100
+ //filter info
101
101
  const { Device: _ignored, ...info } = deviceData;
102
+
103
+ //restFul
102
104
  if (this.restFulEnabled) {
103
105
  this.emit('restFul', 'info', info);
104
106
  this.emit('restFul', 'state', deviceData.Device);
@@ -23,7 +23,7 @@ class MelCloudAtw extends EventEmitter {
23
23
  .on('debug', debug => this.emit('debug', debug));
24
24
 
25
25
  //set default values
26
- this.devicesData = {};
26
+ this.deviceData = {};
27
27
  this.headers = {};
28
28
 
29
29
  //lock flags
@@ -90,22 +90,25 @@ class MelCloudAtw extends EventEmitter {
90
90
  //display info if units are not configured in MELCloud service
91
91
  if (unitsCount === 0 && this.logDebug) if (this.logDebug) this.emit('debug', `Units are not configured in MELCloud service`);
92
92
 
93
+ //filter info
94
+ const { Device: _ignored, ...info } = deviceData;
95
+
93
96
  //restFul
94
97
  if (this.restFulEnabled) {
95
- this.emit('restFul', 'info', deviceData);
98
+ this.emit('restFul', 'info', info);
96
99
  this.emit('restFul', 'state', deviceData.Device);
97
100
  }
98
101
 
99
102
  //mqtt
100
103
  if (this.mqttEnabled) {
101
- this.emit('mqtt', 'Info', deviceData);
104
+ this.emit('mqtt', 'Info', info);
102
105
  this.emit('mqtt', 'State', deviceData.Device);
103
106
  }
104
107
 
105
108
  //check state changes
106
- const deviceDataHasNotChanged = JSON.stringify(devicesData) === JSON.stringify(this.devicesData);
109
+ const deviceDataHasNotChanged = JSON.stringify(deviceData) === JSON.stringify(this.deviceData);
107
110
  if (deviceDataHasNotChanged) return;
108
- this.devicesData = devicesData;
111
+ this.deviceData = deviceData;
109
112
 
110
113
  //emit info
111
114
  this.emit('deviceInfo', indoor.model, outdoor.model, serialNumber, firmwareAppVersion, hasHotWaterTank, hasZone2);
@@ -23,7 +23,7 @@ class MelCloudErv extends EventEmitter {
23
23
  .on('debug', debug => this.emit('debug', debug));
24
24
 
25
25
  //set default values
26
- this.devicesData = {};
26
+ this.deviceData = {};
27
27
  this.headers = {};
28
28
 
29
29
  //lock flags
@@ -92,22 +92,25 @@ class MelCloudErv extends EventEmitter {
92
92
  //display info if units are not configured in MELCloud service
93
93
  if (unitsCount === 0 && this.logDebug) if (this.logDebug) this.emit('debug', `Units are not configured in MELCloud service`);
94
94
 
95
+ //filter info
96
+ const { Device: _ignored, ...info } = deviceData;
97
+
95
98
  //restFul
96
99
  if (this.restFulEnabled) {
97
- this.emit('restFul', 'info', deviceData);
100
+ this.emit('restFul', 'info', info);
98
101
  this.emit('restFul', 'state', deviceData.Device);
99
102
  }
100
103
 
101
104
  //mqtt
102
105
  if (this.mqttEnabled) {
103
- this.emit('mqtt', 'Info', deviceData);
106
+ this.emit('mqtt', 'Info', info);
104
107
  this.emit('mqtt', 'State', deviceData.Device);
105
108
  }
106
109
 
107
110
  //check state changes
108
- const deviceDataHasNotChanged = JSON.stringify(devicesData) === JSON.stringify(this.devicesData);
111
+ const deviceDataHasNotChanged = JSON.stringify(deviceData) === JSON.stringify(this.deviceData);
109
112
  if (deviceDataHasNotChanged) return;
110
- this.devicesData = devicesData;
113
+ this.deviceData = deviceData;
111
114
 
112
115
  //emit info
113
116
  this.emit('deviceInfo', indoor.model, outdoor.model, serialNumber, firmwareAppVersion);