homebridge-melcloud-control 2.5.0-beta.76 → 2.5.0-beta.77

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