homebridge-tasmota-control 1.6.15-beta.10 → 1.6.15-beta.11

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/mielhvac.js +6 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "1.6.15-beta.10",
4
+ "version": "1.6.15-beta.11",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/mielhvac.js CHANGED
@@ -209,7 +209,7 @@ class MiElHvac extends EventEmitter {
209
209
 
210
210
  if (!miElHvac || Object.keys(miElHvac).length === 0) {
211
211
  this.emit('warn', "Empty data received");
212
- return;
212
+ return null;
213
213
  }
214
214
 
215
215
  const power = miElHvac.Power === 'on' ? 1 : 0;
@@ -342,7 +342,7 @@ class MiElHvac extends EventEmitter {
342
342
  break;
343
343
  default:
344
344
  this.emit('warn', `Unknown operating mode: ${operationMode}`);
345
- return;
345
+ return null;
346
346
  }
347
347
 
348
348
  // If power is off, force currentOperationMode to 0 (inactive)
@@ -386,6 +386,8 @@ class MiElHvac extends EventEmitter {
386
386
  obj.fanSpeed = hasAutomaticFanSpeed ? [6, 1, 2, 3, 4, 5][fanIndex] ?? 1 : [0, 1, 2, 3, 4, 5][fanIndex] ?? 1;
387
387
  obj.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 6 : 5;
388
388
  break;
389
+ default:
390
+ this.emit('warn', `Unknown fan speeds: ${numberOfFanSpeeds}`);
389
391
  }
390
392
 
391
393
  // Cap value to max
@@ -1230,7 +1232,8 @@ class MiElHvac extends EventEmitter {
1230
1232
  async start() {
1231
1233
  try {
1232
1234
  //check device state
1233
- await this.checkDeviceState();
1235
+ const checkState = await this.checkDeviceState();
1236
+ if(!checkState) return;
1234
1237
 
1235
1238
  //connect to deice success
1236
1239
  this.emit('success', `Connect Success`)