homebridge-melcloud-control 4.0.0-beta.54 → 4.0.0-beta.56

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 +8 -5
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.0.0-beta.54",
4
+ "version": "4.0.0-beta.56",
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
@@ -219,7 +219,7 @@ class MelCloud extends EventEmitter {
219
219
  const devices = allDevices.map(device => {
220
220
  const settingsArray = device.Settings || device.settings || [];
221
221
 
222
- // Konwersja tablicy [{ name, value }] → { Name: Value } z typami
222
+ // Konwersja tablicy [{ name, value }] → { Name: Value } z poprawnym typem
223
223
  const settingsObject = Object.fromEntries(
224
224
  settingsArray.map(({ name, value }) => {
225
225
  let parsedValue = value;
@@ -233,7 +233,7 @@ class MelCloud extends EventEmitter {
233
233
  })
234
234
  );
235
235
 
236
- // Scal Capabilities + Settings w Device
236
+ // Scal Capabilities + Settings w Device + dodaj DeviceType
237
237
  const deviceObject = {
238
238
  ...Object.fromEntries(
239
239
  Object.entries(device.Capabilities || {}).map(([key, value]) => [
@@ -241,20 +241,23 @@ class MelCloud extends EventEmitter {
241
241
  value
242
242
  ])
243
243
  ),
244
- ...settingsObject
244
+ ...settingsObject,
245
+ DeviceType: device.Type
245
246
  };
246
247
 
247
248
  // Usuń stare pola Settings i Capabilities
248
- const { Settings, settings, Capabilities, ...rest } = device;
249
+ const { Settings, settings, Capabilities, Id, ...rest } = device;
249
250
 
250
251
  return {
251
252
  ...rest,
252
- DeviceID: device.Id,
253
+ DeviceID: Id, // <-- zmiana na DeviceID
253
254
  DeviceName: device.GivenDisplayName,
254
255
  Device: deviceObject
255
256
  };
256
257
  });
257
258
 
259
+
260
+
258
261
  await this.functions.saveData(this.devicesFile, devices);
259
262
  if (this.logDebug) this.emit('debug', `${devicesCount} devices saved`);
260
263