homebridge-melcloud-control 4.2.2-beta.2 → 4.2.2-beta.3

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/package.json +1 -1
  2. package/src/melcloud.js +5 -7
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.2-beta.2",
4
+ "version": "4.2.2-beta.3",
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/melcloud.js CHANGED
@@ -80,18 +80,17 @@ class MelCloud extends EventEmitter {
80
80
  const listDevicesData = await axiosInstance(ApiUrls.ListDevices);
81
81
 
82
82
  if (!listDevicesData || !listDevicesData.data) {
83
- if (this.logWarn) this.emit('warn', `Invalid or empty response from MELCloud API`);
84
- return null;
83
+ devicesList.Info = 'Invalid or empty response from MELCloud API'
84
+ return devicesList;
85
85
  }
86
86
 
87
87
  const buildingsList = listDevicesData.data;
88
88
 
89
- if (this.logDebug)
90
- this.emit('debug', `Buildings: ${JSON.stringify(buildingsList, null, 2)}`);
89
+ if (this.logDebug) this.emit('debug', `Buildings: ${JSON.stringify(buildingsList, null, 2)}`);
91
90
 
92
91
  if (!Array.isArray(buildingsList) || buildingsList.length === 0) {
93
- if (this.logWarn) this.emit('warn', `No buildings found in MELCloud account`);
94
- return null;
92
+ devicesList.Info = 'No building found'
93
+ return devicesList;
95
94
  }
96
95
 
97
96
  await this.functions.saveData(this.buildingsFile, buildingsList);
@@ -227,7 +226,6 @@ class MelCloud extends EventEmitter {
227
226
  if (this.logDebug) this.emit('debug', `Buildings: ${JSON.stringify(buildingsList, null, 2)}`);
228
227
 
229
228
  if (!buildingsList) {
230
- devicesList.State = false;
231
229
  devicesList.Info = 'No building found'
232
230
  return devicesList;
233
231
  }