homebridge-melcloud-control 4.0.0-beta.60 → 4.0.0-beta.62
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/config.schema.json +6 -6
- package/index.js +1 -1
- package/package.json +1 -1
- package/src/melcloud.js +4 -12
- package/src/melcloudata.js +1 -1
package/config.schema.json
CHANGED
|
@@ -235,8 +235,8 @@
|
|
|
235
235
|
"properties": {
|
|
236
236
|
"id": {
|
|
237
237
|
"title": "ID",
|
|
238
|
-
"type": "
|
|
239
|
-
"default": 0,
|
|
238
|
+
"type": "string",
|
|
239
|
+
"default": "0",
|
|
240
240
|
"readonly": true
|
|
241
241
|
},
|
|
242
242
|
"type": {
|
|
@@ -804,8 +804,8 @@
|
|
|
804
804
|
"properties": {
|
|
805
805
|
"id": {
|
|
806
806
|
"title": "ID",
|
|
807
|
-
"type": "
|
|
808
|
-
"default": 0,
|
|
807
|
+
"type": "string",
|
|
808
|
+
"default": "0",
|
|
809
809
|
"readonly": true
|
|
810
810
|
},
|
|
811
811
|
"type": {
|
|
@@ -1339,8 +1339,8 @@
|
|
|
1339
1339
|
"properties": {
|
|
1340
1340
|
"id": {
|
|
1341
1341
|
"title": "ID",
|
|
1342
|
-
"type": "
|
|
1343
|
-
"default": 0,
|
|
1342
|
+
"type": "string",
|
|
1343
|
+
"default": "0",
|
|
1344
1344
|
"readonly": true
|
|
1345
1345
|
},
|
|
1346
1346
|
"type": {
|
package/index.js
CHANGED
|
@@ -134,7 +134,7 @@ class MelCloudPlatform {
|
|
|
134
134
|
//chack device from config exist on melcloud
|
|
135
135
|
const deviceId = device.id;
|
|
136
136
|
const displayMode = device.displayMode > 0;
|
|
137
|
-
const deviceExistInMelCloud = devicesInMelcloud.some(dev => dev.DeviceID
|
|
137
|
+
const deviceExistInMelCloud = devicesInMelcloud.some(dev => dev.DeviceID == deviceId);
|
|
138
138
|
if (!deviceExistInMelCloud || !displayMode) {
|
|
139
139
|
continue;
|
|
140
140
|
}
|
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.
|
|
4
|
+
"version": "4.0.0-beta.62",
|
|
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
|
@@ -233,7 +233,7 @@ class MelCloud extends EventEmitter {
|
|
|
233
233
|
|
|
234
234
|
return {
|
|
235
235
|
...rest,
|
|
236
|
-
Type: type,
|
|
236
|
+
Type: type,
|
|
237
237
|
DeviceID: Id,
|
|
238
238
|
DeviceName: GivenDisplayName,
|
|
239
239
|
Device: deviceObject
|
|
@@ -247,22 +247,14 @@ class MelCloud extends EventEmitter {
|
|
|
247
247
|
];
|
|
248
248
|
});
|
|
249
249
|
|
|
250
|
-
|
|
251
|
-
if (
|
|
252
|
-
if (this.logWarn) this.emit('warn', `No devices found`);
|
|
253
|
-
return null;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
// Jeśli nie ma urządzeń
|
|
258
|
-
if (devices.length === 0) {
|
|
250
|
+
const devicesCount = devices.length;
|
|
251
|
+
if (devicesCount === 0) {
|
|
259
252
|
if (this.logWarn) this.emit('warn', `No devices found`);
|
|
260
253
|
return null;
|
|
261
254
|
}
|
|
262
255
|
|
|
263
|
-
|
|
264
256
|
await this.functions.saveData(this.devicesFile, devices);
|
|
265
|
-
if (this.logDebug) this.emit('debug', `${
|
|
257
|
+
if (this.logDebug) this.emit('debug', `${devicesCount} devices saved`);
|
|
266
258
|
|
|
267
259
|
return devices;
|
|
268
260
|
} catch (error) {
|
package/src/melcloudata.js
CHANGED
|
@@ -8,7 +8,7 @@ import { ApiUrls } from './constants.js';
|
|
|
8
8
|
class MelCloudAta extends EventEmitter {
|
|
9
9
|
constructor(device, contextKey, devicesFile) {
|
|
10
10
|
super();
|
|
11
|
-
this.deviceId = device.id;
|
|
11
|
+
this.deviceId = parseInt(device.id);
|
|
12
12
|
this.logWarn = device.log?.warn;
|
|
13
13
|
this.logDebug = device.log?.debug;
|
|
14
14
|
this.devicesFile = devicesFile;
|