homebridge-tasmota-control 1.6.15-beta.13 → 1.6.15-beta.16

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.
@@ -709,12 +709,6 @@
709
709
  42
710
710
  ]
711
711
  },
712
- {
713
- "title": "AIR DIRECTION OFF",
714
- "enum": [
715
- 43
716
- ]
717
- },
718
712
  {
719
713
  "title": "LOCK CONTROL All (only as sensor now)",
720
714
  "enum": [
package/index.js CHANGED
@@ -158,20 +158,20 @@ class tasmotaPlatform {
158
158
  });
159
159
 
160
160
  //create impulse generator
161
- const impulseGenerator = new ImpulseGenerator();
162
- impulseGenerator.on('start', async () => {
163
- try {
164
- const startDone = await deviceType.start();
165
- const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
166
-
167
- //start impulse generator
168
- const startImpulseGenerator = stopImpulseGenerator ? await deviceType.startImpulseGenerator() : false
169
- } catch (error) {
170
- const emitLog = disableLogError ? false : log.error(`Device: ${host} ${deviceName}, ${error}, trying again.`);
171
- }
172
- }).on('state', (state) => {
173
- const emitLog = !enableDebugMode ? false : state ? log.info(`Device: ${host} ${deviceName}, Start impulse generator started.`) : log.info(`Device: ${host} ${deviceName}, Start impulse generator stopped.`);
174
- });
161
+ const impulseGenerator = new ImpulseGenerator()
162
+ .on('start', async () => {
163
+ try {
164
+ const startDone = await deviceType.start();
165
+ const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
166
+
167
+ //start impulse generator
168
+ const startImpulseGenerator = stopImpulseGenerator ? await deviceType.startImpulseGenerator() : false
169
+ } catch (error) {
170
+ const emitLog = disableLogError ? false : log.error(`Device: ${host} ${deviceName}, ${error}, trying again.`);
171
+ }
172
+ }).on('state', (state) => {
173
+ const emitLog = !enableDebugMode ? false : state ? log.info(`Device: ${host} ${deviceName}, Start impulse generator started.`) : log.info(`Device: ${host} ${deviceName}, Start impulse generator stopped.`);
174
+ });
175
175
 
176
176
  //start impulse generator
177
177
  await impulseGenerator.start([{ name: 'start', sampling: 45000 }]);
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.13",
4
+ "version": "1.6.15-beta.16",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/constants.js CHANGED
@@ -68,7 +68,6 @@ export const MiElHVAC = {
68
68
  "indirect": "HVACSetAirDirection%20indirect",
69
69
  "direct": "HVACSetAirDirection%20direct",
70
70
  "even": "HVACSetAirDirection%20even",
71
- "off": "HVACSetAirDirection%20off"
72
71
  },
73
72
  "SetProhibit": {
74
73
  "off": "HVACSetProhibit%20off",
package/src/mielhvac.js CHANGED
@@ -219,9 +219,9 @@ class MiElHvac extends EventEmitter {
219
219
  const outdoorTemperature = miElHvac.OutdoorTemperature ?? null;
220
220
  const setTemperature = miElHvac.SetTemperature;
221
221
  const operationMode = miElHvac.Mode ?? 'Unknown';
222
- const operationModeStage = miElHvac.ModeStage ?? 'Unknown';
222
+ const operationModeStatus = miElHvac.ModeStatus ?? 'Unknown';
223
223
  const fanSpeed = miElHvac.FanSpeed ?? 'Unknown';
224
- const fanSpeedStage = miElHvac.FanStage ?? 'Unknown';
224
+ const fanSpeedStatus = miElHvac.FanStatus ?? 'Unknown';
225
225
  const vaneVerticalDirection = miElHvac.SwingV ?? 'Unknown';
226
226
  const vaneHorizontalDirection = miElHvac.SwingH ?? 'Unknown';
227
227
  const prohibit = miElHvac.Prohibit ?? 'Unknown';
@@ -231,7 +231,7 @@ class MiElHvac extends EventEmitter {
231
231
  const compressorFrequency = miElHvac.CompressorFrequency ?? 0;
232
232
  const operationPower = miElHvac.OperationPower ?? 0;
233
233
  const operationEnergy = miElHvac.OperationEnergy ?? 0;
234
- const operationStage = miElHvac.OperationStage ?? 'Unknown';
234
+ const operationStatus = miElHvac.OperationStatus ?? 'Unknown';
235
235
  const swingMode = vaneVerticalDirection === 'swing' && vaneHorizontalDirection === 'swing' ? 1 : 0;
236
236
  const defaultCoolingSetTemperature = parseFloat(await this.readData(this.info.defaultCoolingSetTemperatureFile));
237
237
  const defaultHeatingSetTemperature = parseFloat(await this.readData(this.info.defaultHeatingSetTemperatureFile));
@@ -259,7 +259,7 @@ class MiElHvac extends EventEmitter {
259
259
  outdoorTemperature: outdoorTemperature,
260
260
  setTemperature: setTemperature,
261
261
  operationMode: operationMode,
262
- operationModeStage: operationModeStage,
262
+ operationModeStatus: operationModeStatus,
263
263
  currentOperationMode: 0,
264
264
  targetOperationMode: 0,
265
265
  vaneVerticalDirection: vaneVerticalDirection,
@@ -272,7 +272,7 @@ class MiElHvac extends EventEmitter {
272
272
  compressorFrequency: compressorFrequency,
273
273
  operationPower: operationPower,
274
274
  operationEnergy: operationEnergy,
275
- operationStage: operationStage,
275
+ operationStatus: operationStatus,
276
276
  defaultCoolingSetTemperature: defaultCoolingSetTemperature,
277
277
  defaultHeatingSetTemperature: defaultHeatingSetTemperature,
278
278
  remoteTemperatureSensorState: remoteTemperatureSensorState,
@@ -292,8 +292,8 @@ class MiElHvac extends EventEmitter {
292
292
  hideVaneControls: hideVaneControls
293
293
  };
294
294
 
295
- // Map stages to index safely, fallback to 0 if not found
296
- const operationModeStageMap = {
295
+ // Map status to index safely, fallback to 0 if not found
296
+ const operationModeStatusMap = {
297
297
  'manual': 0,
298
298
  'heat': 2,
299
299
  'dry': 1,
@@ -308,38 +308,38 @@ class MiElHvac extends EventEmitter {
308
308
  'auto_leader': 4
309
309
  };
310
310
 
311
- const stageIndex = operationModeStageMap[operationModeStage] ?? 0;
311
+ const statusIndex = operationModeStatusMap[operationModeStatus] ?? 0;
312
312
  switch (operationMode) {
313
313
  case 'heat':
314
- obj.currentOperationMode = [2, 1, 2, 3, 0][stageIndex]; // INACTIVE, IDLE, HEATING, COOLING
314
+ obj.currentOperationMode = [2, 1, 2, 3, 0][statusIndex]; // INACTIVE, IDLE, HEATING, COOLING
315
315
  obj.targetOperationMode = 1; // AUTO, HEAT, COOL
316
316
  break;
317
317
  case 'dry':
318
- obj.currentOperationMode = [1, 1, 2, 3, 0][stageIndex];
318
+ obj.currentOperationMode = [1, 1, 2, 3, 0][statusIndex];
319
319
  obj.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : obj.targetOperationMode;
320
320
  break;
321
321
  case 'cool':
322
- obj.currentOperationMode = [3, 1, 2, 3, 0][stageIndex];
322
+ obj.currentOperationMode = [3, 1, 2, 3, 0][statusIndex];
323
323
  obj.targetOperationMode = 2;
324
324
  break;
325
325
  case 'fan':
326
- obj.currentOperationMode = [1, 1, 2, 3, 0][stageIndex];
326
+ obj.currentOperationMode = [1, 1, 2, 3, 0][statusIndex];
327
327
  obj.targetOperationMode = this.autoDryFanMode === 3 ? 0 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : obj.targetOperationMode;
328
328
  break;
329
329
  case 'auto':
330
- obj.currentOperationMode = [2, 1, 2, 3, 0][stageIndex];
330
+ obj.currentOperationMode = [2, 1, 2, 3, 0][statusIndex];
331
331
  obj.targetOperationMode = 0;
332
332
  break;
333
333
  case 'heat_isee':
334
- obj.currentOperationMode = [2, 1, 2, 3, 0][stageIndex];
334
+ obj.currentOperationMode = [2, 1, 2, 3, 0][statusIndex];
335
335
  obj.targetOperationMode = 1;
336
336
  break;
337
337
  case 'dry_isee':
338
- obj.currentOperationMode = [1, 1, 2, 3, 0][stageIndex];
338
+ obj.currentOperationMode = [1, 1, 2, 3, 0][statusIndex];
339
339
  obj.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : obj.targetOperationMode;
340
340
  break;
341
341
  case 'cool_isee':
342
- obj.currentOperationMode = [3, 1, 2, 3, 0][stageIndex];
342
+ obj.currentOperationMode = [3, 1, 2, 3, 0][statusIndex];
343
343
  obj.targetOperationMode = 2;
344
344
  break;
345
345
  default:
@@ -514,7 +514,6 @@ class MiElHvac extends EventEmitter {
514
514
  40: () => power && airDirection === 'indirect',
515
515
  41: () => power && airDirection === 'direct',
516
516
  42: () => power && airDirection === 'even',
517
- 43: () => power && !['indirect', 'direct', 'even'].includes(airDirection),
518
517
  };
519
518
 
520
519
  const prohibitMap = {
@@ -616,24 +615,24 @@ class MiElHvac extends EventEmitter {
616
615
 
617
616
  60: remoteTemperatureSensorState,
618
617
 
619
- 70: operationStage === 'normal',
620
- 71: operationStage === 'defrost',
621
- 72: operationStage === 'preheat',
622
- 73: operationStage === 'standby',
618
+ 70: operationStatus === 'normal',
619
+ 71: operationStatus === 'defrost',
620
+ 72: operationStatus === 'preheat',
621
+ 73: operationStatus === 'standby',
623
622
 
624
- 80: fanSpeedStage === 'off',
625
- 81: fanSpeedStage === 'quiet',
626
- 82: fanSpeedStage === '1',
627
- 83: fanSpeedStage === '2',
628
- 84: fanSpeedStage === '3',
629
- 85: fanSpeedStage === '4',
630
- 86: fanSpeedStage === '5',
623
+ 80: fanSpeedStatus === 'off',
624
+ 81: fanSpeedStatus === 'quiet',
625
+ 82: fanSpeedStatus === '1',
626
+ 83: fanSpeedStatus === '2',
627
+ 84: fanSpeedStatus === '3',
628
+ 85: fanSpeedStatus === '4',
629
+ 86: fanSpeedStatus === '5',
631
630
 
632
631
  90: operationMode !== 'auto',
633
- 91: operationModeStage === 'auto_fan',
634
- 92: operationModeStage === 'auto_heat',
635
- 93: operationModeStage === 'auto_cool',
636
- 94: operationModeStage === 'auto_leader',
632
+ 91: operationModeStatus === 'auto_fan',
633
+ 92: operationModeStatus === 'auto_heat',
634
+ 93: operationModeStatus === 'auto_cool',
635
+ 94: operationModeStatus === 'auto_leader',
637
636
  };
638
637
 
639
638
  if (mode in sensorStates) {
@@ -666,12 +665,12 @@ class MiElHvac extends EventEmitter {
666
665
  if (!this.disableLogInfo) {
667
666
  this.emit('info', `Power: ${power ? 'ON' : 'OFF'}`);
668
667
  const info = power ? this.emit('info', `Target operation mode: ${operationMode.toUpperCase()}`) : false;
669
- const info1 = power ? this.emit('info', `Current operation mode: ${operationModeStage.toUpperCase()}`) : false;
668
+ const info1 = power ? this.emit('info', `Current operation mode: ${operationModeStatus.toUpperCase()}`) : false;
670
669
  const info2 = power ? this.emit('info', `Target temperature: ${setTemperature}${temperatureUnit}`) : false;
671
670
  const info3 = power ? this.emit('info', `Current temperature: ${roomTemperature}${temperatureUnit}`) : false;
672
671
  const info4 = power && outdoorTemperature !== null ? this.emit('info', `Outdoor temperature: ${outdoorTemperature}${temperatureUnit}`) : false;
673
672
  const info5 = power && modelSupportsFanSpeed ? this.emit('info', `Target Fan speed: ${fanSpeed.toUpperCase()}`) : false;
674
- const info6 = power && modelSupportsFanSpeed ? this.emit('info', `Current Fan speed: ${fanSpeedStage.toUpperCase()}`) : false;
673
+ const info6 = power && modelSupportsFanSpeed ? this.emit('info', `Current Fan speed: ${fanSpeedStatus.toUpperCase()}`) : false;
675
674
  const info7 = power && vaneHorizontalDirection !== 'Unknown' ? this.emit('info', `Vane horizontal: ${MiElHVAC.HorizontalVane[vaneHorizontalDirection] ?? vaneHorizontalDirection}`) : false;
676
675
  const info8 = power && vaneVerticalDirection !== 'Unknown' ? this.emit('info', `Vane vertical: ${MiElHVAC.VerticalVane[vaneVerticalDirection] ?? vaneVerticalDirection}`) : false;
677
676
  const info9 = power ? this.emit('info', `Swing mode: ${MiElHVAC.SwingMode[swingMode]}`) : false;
@@ -1098,7 +1097,6 @@ class MiElHvac extends EventEmitter {
1098
1097
  40: () => getCommand('SetAirDirection', 'indirect'),
1099
1098
  41: () => getCommand('SetAirDirection', 'direct'),
1100
1099
  42: () => getCommand('SetAirDirection', 'even'),
1101
- 43: () => getCommand('SetAirDirection', 'off'),
1102
1100
 
1103
1101
  // Prohibit
1104
1102
  50: () => getCommand('SetProhibit', 'all'),