homebridge-melcloud-control 3.8.0-beta.2 → 3.8.0-beta.21
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 +84 -12
- package/index.js +4 -4
- package/package.json +1 -1
- package/src/deviceata.js +10 -13
- package/src/deviceatw.js +680 -687
- package/src/deviceerv.js +10 -13
- package/src/melcloudata.js +1 -1
- package/src/melcloudatw.js +1 -1
- package/src/melclouderv.js +1 -1
package/src/deviceerv.js
CHANGED
|
@@ -237,6 +237,7 @@ class DeviceErv extends EventEmitter {
|
|
|
237
237
|
async startImpulseGenerator() {
|
|
238
238
|
try {
|
|
239
239
|
//start impule generator
|
|
240
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
240
241
|
await this.melCloudErv.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
|
|
241
242
|
return true;
|
|
242
243
|
} catch (error) {
|
|
@@ -889,7 +890,7 @@ class DeviceErv extends EventEmitter {
|
|
|
889
890
|
this.firmwareRevision = firmwareAppVersion;
|
|
890
891
|
this.displayDeviceInfo = false;
|
|
891
892
|
})
|
|
892
|
-
.on('deviceState', (deviceData) => {
|
|
893
|
+
.on('deviceState', async (deviceData) => {
|
|
893
894
|
this.deviceData = deviceData;
|
|
894
895
|
|
|
895
896
|
//presets
|
|
@@ -1234,6 +1235,13 @@ class DeviceErv extends EventEmitter {
|
|
|
1234
1235
|
const info7 = hasPM25Sensor ? this.emit('message', `PM2.5 air quality: ${Ventilation.PM25AirQuality[pM25AirQuality]}`) : false;
|
|
1235
1236
|
const info8 = hasPM25Sensor ? this.emit('message', `PM2.5 level: ${pM25Level} µg/m`) : false;
|
|
1236
1237
|
};
|
|
1238
|
+
|
|
1239
|
+
//prepare accessory
|
|
1240
|
+
if (this.startPrepareAccessory) {
|
|
1241
|
+
const accessory = await this.prepareAccessory(this.accountInfo, deviceData, this.deviceId, this.deviceTypeText, this.deviceName, this.accountName);
|
|
1242
|
+
this.emit('publishAccessory', accessory);
|
|
1243
|
+
this.startPrepareAccessory = false;
|
|
1244
|
+
}
|
|
1237
1245
|
})
|
|
1238
1246
|
.on('success', (success) => {
|
|
1239
1247
|
this.emit('success', success);
|
|
@@ -1261,18 +1269,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1261
1269
|
const startExternalIntegrations = this.restFul.enable || this.mqtt.enable ? await this.externalIntegrations() : false;
|
|
1262
1270
|
|
|
1263
1271
|
//check state
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
if (deviceData === false) {
|
|
1267
|
-
return null;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
//prepare accessory
|
|
1271
|
-
if (this.startPrepareAccessory) {
|
|
1272
|
-
const accessory = await this.prepareAccessory(this.accountInfo, deviceData, this.deviceId, this.deviceTypeText, this.deviceName, this.accountName);
|
|
1273
|
-
this.emit('publishAccessory', accessory);
|
|
1274
|
-
this.startPrepareAccessory = false;
|
|
1275
|
-
}
|
|
1272
|
+
await this.melCloudErv.checkState();
|
|
1276
1273
|
|
|
1277
1274
|
return true;
|
|
1278
1275
|
} catch (error) {
|
package/src/melcloudata.js
CHANGED
package/src/melcloudatw.js
CHANGED
package/src/melclouderv.js
CHANGED