homebridge-melcloud-control 4.2.3-beta.38 → 4.2.3-beta.39

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/melcloudhome.js +15 -24
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.3-beta.38",
4
+ "version": "4.2.3-beta.39",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -75,33 +75,24 @@ class MelCloud extends EventEmitter {
75
75
  const scenesList = listScenesData.data;
76
76
  if (this.logDebug) this.emit('debug', `Scenes: ${JSON.stringify(scenesList, null, 2)}`);
77
77
 
78
- const scenes = scenesList.flatMap(scene => {
79
- const capitalizeKeysDeep = obj => {
80
- if (Array.isArray(obj)) {
81
- return obj.map(item => capitalizeKeysDeep(item));
82
- }
83
-
84
- if (obj && typeof obj === 'object') {
85
- return Object.fromEntries(
86
- Object.entries(obj).map(([key, value]) => [
87
- key.charAt(0).toUpperCase() + key.slice(1),
88
- capitalizeKeysDeep(value)
89
- ])
90
- );
91
- }
78
+ const capitalizeKeysDeep = obj => {
79
+ if (Array.isArray(obj)) {
80
+ return obj.map(item => capitalizeKeysDeep(item));
81
+ }
92
82
 
93
- return obj;
94
- };
83
+ if (obj && typeof obj === 'object') {
84
+ return Object.fromEntries(
85
+ Object.entries(obj).map(([key, value]) => [
86
+ key.charAt(0).toUpperCase() + key.slice(1),
87
+ capitalizeKeysDeep(value)
88
+ ])
89
+ );
90
+ }
95
91
 
96
- const allSettings = [
97
- ...(scene.ataSceneSettings || []),
98
- ...(scene.ervSceneSettings || []),
99
- ...(scene.atwSceneSettings || [])
100
- ];
92
+ return obj;
93
+ };
101
94
 
102
- return allSettings.map(setting => capitalizeKeysDeep(setting));
103
- });
104
- return scenes;
95
+ return scenesList.map(scene => capitalizeKeysDeep(scene));
105
96
  } catch (error) {
106
97
  throw new Error(`Check scenes list error: ${error.message}`);
107
98
  }