homebridge-melcloud-control 2.5.0-beta.86 → 2.5.0-beta.87

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.
Files changed (2) hide show
  1. package/index.js +6 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -78,14 +78,12 @@ class MelCloudPlatform {
78
78
 
79
79
  //Air Conditioner
80
80
  for (const device of account.ataDevices) {
81
- const id = device.id ?? false;
82
-
83
81
  //check id exist
84
- if (!id) {
82
+ if (!device.id || !device.type) {
85
83
  continue;
86
84
  };
87
85
 
88
- const deviceId = id.toString();
86
+ const deviceId = device.id.toString();
89
87
  const deviceType = device.type;
90
88
  const deviceName = device.name;
91
89
  const deviceTypeText = CONSTANTS.DeviceType[deviceType];
@@ -119,14 +117,12 @@ class MelCloudPlatform {
119
117
 
120
118
  //Heat Pump
121
119
  for (const device of account.atwDevices) {
122
- const id = device.id ?? false;
123
-
124
120
  //check id exist
125
- if (!id) {
121
+ if (!device.id || !device.type) {
126
122
  continue;
127
123
  };
128
124
 
129
- const deviceId = id.toString();
125
+ const deviceId = device.id.toString();
130
126
  const deviceType = device.type;
131
127
  const deviceName = device.name;
132
128
  const deviceTypeText = CONSTANTS.DeviceType[deviceType];
@@ -160,14 +156,12 @@ class MelCloudPlatform {
160
156
 
161
157
  //Energy Recovery Ventilation
162
158
  for (const device of account.ervDevices) {
163
- const id = device.id ?? false;
164
-
165
159
  //check id exist
166
- if (!id) {
160
+ if (!device.id || !device.type) {
167
161
  continue;
168
162
  };
169
163
 
170
- const deviceId = id.toString();
164
+ const deviceId = device.id.toString();
171
165
  const deviceType = device.type;
172
166
  const deviceName = device.name;
173
167
  const deviceTypeText = CONSTANTS.DeviceType[deviceType];
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.86",
4
+ "version": "2.5.0-beta.87",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",