homebridge-tasmota-control 1.0.0 → 1.0.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -40,9 +40,9 @@ class TasmotaDevice extends EventEmitter {
40
40
  const remoteTemperatureSensorPasswd = remoteTemperatureSensor.passwd;
41
41
 
42
42
  //presets
43
- this.presets = miElHvac.presets || [];
43
+ const presets = miElHvac.presets || [];
44
44
  this.presetsConfigured = [];
45
- for (const preset of this.presets) {
45
+ for (const preset of presets) {
46
46
  const presetName = preset.name ?? false;
47
47
  const presetDisplayType = preset.displayType ?? 0;
48
48
  const presetNamePrefix = preset.namePrefix ?? false;
@@ -62,9 +62,9 @@ class TasmotaDevice extends EventEmitter {
62
62
  this.presetsConfiguredCount = this.presetsConfigured.length || 0;
63
63
 
64
64
  //buttons
65
- this.buttons = miElHvac.buttons || [];
65
+ const buttons = miElHvac.buttons || [];
66
66
  this.buttonsConfigured = [];
67
- for (const button of this.buttons) {
67
+ for (const button of buttons) {
68
68
  const buttonName = button.name ?? false;
69
69
  const buttonMode = button.mode ?? -1;
70
70
  const buttonDisplayType = button.displayType ?? 0;
@@ -85,9 +85,9 @@ class TasmotaDevice extends EventEmitter {
85
85
  this.buttonsConfiguredCount = this.buttonsConfigured.length || 0;
86
86
 
87
87
  //sensors
88
- this.sensors = miElHvac.sensors || [];
88
+ const sensors = miElHvac.sensors || [];
89
89
  this.sensorsConfigured = [];
90
- for (const sensor of this.buttons) {
90
+ for (const sensor of sensors) {
91
91
  const sensorName = sensor.name ?? false;
92
92
  const sensorMode = sensor.mode ?? -1;
93
93
  const sensorDisplayType = sensor.displayType ?? 0;
@@ -105,7 +105,7 @@ class TasmotaDevice extends EventEmitter {
105
105
  const log = sensorDisplayType === 0 ? false : this.emit('warn', `Sensor Name: ${sensorName ? sensorName : 'Missing'}, Mode: ${sensorMode ? sensorMode : 'Missing'}.`);
106
106
  };
107
107
  }
108
- this.sensorsConfigured = this.sensorsConfigured.length || 0;
108
+ this.sensorsConfiguredCount = this.sensorsConfigured.length || 0;
109
109
 
110
110
  //frost protect
111
111
  const frostProtect = miElHvac.frostProtect ?? {};