homebridge-melcloud-control 3.1.8 → 3.1.9

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/CHANGELOG.md CHANGED
@@ -16,6 +16,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
16
  - do not configure it manually, always using Config UI X
17
17
  - required Homebridge v2.0.0 and above
18
18
 
19
+ ## [3.1.9] - (05.08.2024)
20
+
21
+ ## Changes
22
+
23
+ - prevent load device if display mode set to 0 or unknown [#150](https://github.com/grzegorz914/homebridge-melcloud-control/issues/150)
24
+ - cleanup
25
+
19
26
  ## [3.1.8] - (03.08.2024)
20
27
 
21
28
  ## Changes
package/index.js CHANGED
@@ -107,8 +107,9 @@ class MelCloudPlatform {
107
107
  for (const device of account.ataDevices) {
108
108
  //chack device from config exist on melcloud
109
109
  const deviceId = device.id;
110
+ const displayMode = device.displayMode > 0 ?? false;
110
111
  const deviceExistInMelCloud = devices.some(dev => dev.DeviceID === deviceId);
111
- if (!deviceExistInMelCloud || device.displayMode === 0) {
112
+ if (!deviceExistInMelCloud || !displayMode) {
112
113
  continue;
113
114
  };
114
115
 
@@ -145,8 +146,9 @@ class MelCloudPlatform {
145
146
  for (const device of account.atwDevices) {
146
147
  //chack device from config exist on melcloud
147
148
  const deviceId = device.id;
148
- const deviceExistInMelCloud = devices.some(dev => dev.DeviceID === device.id);
149
- if (!deviceExistInMelCloud || device.displayMode === 0) {
149
+ const displayMode = device.displayMode > 0 ?? false;
150
+ const deviceExistInMelCloud = devices.some(dev => dev.DeviceID === deviceId);
151
+ if (!deviceExistInMelCloud || !displayMode) {
150
152
  continue;
151
153
  };
152
154
 
@@ -183,8 +185,9 @@ class MelCloudPlatform {
183
185
  for (const device of account.ervDevices) {
184
186
  //chack device from config exist on melcloud
185
187
  const deviceId = device.id;
186
- const deviceExistInMelCloud = devices.some(dev => dev.DeviceID === device.id);
187
- if (!deviceExistInMelCloud || device.displayMode === 0) {
188
+ const displayMode = device.displayMode > 0 ?? false;
189
+ const deviceExistInMelCloud = devices.some(dev => dev.DeviceID === deviceId);
190
+ if (!deviceExistInMelCloud || !displayMode) {
188
191
  continue;
189
192
  };
190
193
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "3.1.8",
4
+ "version": "3.1.9",
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/deviceatw.js CHANGED
@@ -440,9 +440,6 @@ class DeviceAtw extends EventEmitter {
440
440
  .updateCharacteristic(Characteristic.TemperatureDisplayUnits, useFahrenheit);
441
441
  }
442
442
  break;
443
- default: //unknown display type detected
444
- this.emit('message', `Unknown display type: ${displayType} detected.`);
445
- break;
446
443
  };
447
444
 
448
445
  //push value to arrays