homebridge-tasmota-control 1.6.15-beta.28 → 1.6.15-beta.29

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.6.15-beta.28",
4
+ "version": "1.6.15-beta.29",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/fans.js CHANGED
@@ -43,21 +43,22 @@ class Fans extends EventEmitter {
43
43
 
44
44
  //impulse generator
45
45
  this.call = false;
46
- this.impulseGenerator = new ImpulseGenerator();
47
- this.impulseGenerator.on('checkDeviceState', async () => {
48
- if (this.call) return;
49
-
50
- try {
51
- this.call = true;
52
- await this.checkDeviceState();
53
- this.call = false;
54
- } catch (error) {
55
- this.call = false;
56
- this.emit('error', `Inpulse generator error: ${error}`);
57
- };
58
- }).on('state', (state) => {
59
- const emitState = state ? this.emit('success', `Impulse generator started`) : this.emit('warn', `Impulse generator stopped`);
60
- });
46
+ this.impulseGenerator = new ImpulseGenerator()
47
+ .on('checkDeviceState', async () => {
48
+ if (this.call) return;
49
+
50
+ try {
51
+ this.call = true;
52
+ await this.checkDeviceState();
53
+ this.call = false;
54
+ } catch (error) {
55
+ this.call = false;
56
+ this.emit('error', `Inpulse generator error: ${error}`);
57
+ };
58
+ })
59
+ .on('state', (state) => {
60
+ this.emit('success', `Impulse generator ${state ? 'started' : 'stopped'}.`);
61
+ });
61
62
  }
62
63
 
63
64
  async checkDeviceState() {
package/src/lights.js CHANGED
@@ -41,21 +41,22 @@ class Lights extends EventEmitter {
41
41
  });
42
42
 
43
43
  this.call = false;
44
- this.impulseGenerator = new ImpulseGenerator();
45
- this.impulseGenerator.on('checkDeviceState', async () => {
46
- if (this.call) return;
47
-
48
- try {
49
- this.call = true;
50
- await this.checkDeviceState();
51
- this.call = false;
52
- } catch (error) {
53
- this.call = false;
54
- this.emit('error', `Inpulse generator error: ${error}`);
55
- };
56
- }).on('state', (state) => {
57
- const emitState = state ? this.emit('success', `Impulse generator started`) : this.emit('warn', `Impulse generator stopped`);
58
- });
44
+ this.impulseGenerator = new ImpulseGenerator()
45
+ .on('checkDeviceState', async () => {
46
+ if (this.call) return;
47
+
48
+ try {
49
+ this.call = true;
50
+ await this.checkDeviceState();
51
+ this.call = false;
52
+ } catch (error) {
53
+ this.call = false;
54
+ this.emit('error', `Inpulse generator error: ${error}`);
55
+ };
56
+ })
57
+ .on('state', (state) => {
58
+ this.emit('success', `Impulse generator ${state ? 'started' : 'stopped'}.`);
59
+ });
59
60
  }
60
61
 
61
62
  async checkDeviceState() {
@@ -144,10 +145,10 @@ class Lights extends EventEmitter {
144
145
  //log info
145
146
  if (!this.disableLogInfo) {
146
147
  this.emit('info', `${friendlyName}, state: ${power ? 'ON' : 'OFF'}`);
147
- const logInfo = brightnessType === 0 ? false : this.emit('info', `${friendlyName}, brightness: ${bright} %`);
148
- const logInfo1 = colorTemperature === false ? false : this.emit('info', `${friendlyName}, color temperatur: ${colorTemperature}`);
149
- const logInfo2 = hue === false ? false : this.emit('info', `${friendlyName}, hue: ${hue}`);
150
- const logInfo3 = saturation === false ? false : this.emit('info', `${friendlyName}, saturation: ${saturation}`);
148
+ if (brightnessType !== 0) this.emit('info', `${friendlyName}, brightness: ${bright} %`);
149
+ if (colorTemperature) this.emit('info', `${friendlyName}, color temperatur: ${colorTemperature}`);
150
+ if (hue) this.emit('info', `${friendlyName}, hue: ${hue}`);
151
+ if (saturation) this.emit('info', `${friendlyName}, saturation: ${saturation}`);
151
152
  }
152
153
  }
153
154
  }
@@ -186,7 +187,7 @@ class Lights extends EventEmitter {
186
187
  async startImpulseGenerator() {
187
188
  try {
188
189
  //start impulse generator
189
- const timers = [{ name: 'checkDeviceState', sampling: this.refreshInterval }]; e;
190
+ const timers = [{ name: 'checkDeviceState', sampling: this.refreshInterval }];
190
191
  await this.impulseGenerator.start(timers);
191
192
  return true;
192
193
  } catch (error) {
package/src/mielhvac.js CHANGED
@@ -150,31 +150,33 @@ class MiElHvac extends EventEmitter {
150
150
  //impulse generator
151
151
  this.call = false;
152
152
  this.call1 = false;
153
- this.impulseGenerator = new ImpulseGenerator();
154
- this.impulseGenerator.on('checkDeviceState', async () => {
155
- if (this.call) return;
156
-
157
- try {
158
- this.call = true;
159
- await this.checkDeviceState();
160
- this.call = false;
161
- } catch (error) {
162
- this.call = false;
163
- this.emit('error', `Inpulse generator error: ${error}`);
164
- };
165
- }).on('updateRemoteTemp', async () => {
166
- if (this.call1) return;
167
-
168
- try {
169
- this.call1 = true;
170
- await this.updateRemoteTemp();
171
- } catch (error) {
172
- this.call1 = false;
173
- this.emit('error', `Impulse generator error: ${error}`);
174
- }
175
- }).on('state', (state) => {
176
- const emitState = state ? this.emit('success', `Impulse generator started`) : this.emit('warn', `Impulse generator stopped`);
177
- });
153
+ this.impulseGenerator = new ImpulseGenerator()
154
+ .on('checkDeviceState', async () => {
155
+ if (this.call) return;
156
+
157
+ try {
158
+ this.call = true;
159
+ await this.checkDeviceState();
160
+ this.call = false;
161
+ } catch (error) {
162
+ this.call = false;
163
+ this.emit('error', `Inpulse generator error: ${error}`);
164
+ };
165
+ })
166
+ .on('updateRemoteTemp', async () => {
167
+ if (this.call1) return;
168
+
169
+ try {
170
+ this.call1 = true;
171
+ await this.updateRemoteTemp();
172
+ } catch (error) {
173
+ this.call1 = false;
174
+ this.emit('error', `Impulse generator error: ${error}`);
175
+ }
176
+ })
177
+ .on('state', (state) => {
178
+ this.emit('success', `Impulse generator ${state ? 'started' : 'stopped'}.`);
179
+ });
178
180
  }
179
181
 
180
182
  async checkDeviceState() {
@@ -746,7 +748,7 @@ class MiElHvac extends EventEmitter {
746
748
  try {
747
749
  //start impulse generator
748
750
  const timers = [{ name: 'checkDeviceState', sampling: this.refreshInterval }];
749
- const remoteTempSensor = this.remoteTemperatureSensorEnable ? timers.push({ name: 'updateRemoteTemp', sampling: this.remoteTemperatureSensorRefreshInterval }) : false;
751
+ if (this.remoteTemperatureSensorEnable) timers.push({ name: 'updateRemoteTemp', sampling: this.remoteTemperatureSensorRefreshInterval });
750
752
  await this.impulseGenerator.start(timers);
751
753
  return true;
752
754
  } catch (error) {
package/src/sensors.js CHANGED
@@ -44,21 +44,22 @@ class Sensors extends EventEmitter {
44
44
 
45
45
  //impulse generator
46
46
  this.call = false;
47
- this.impulseGenerator = new ImpulseGenerator();
48
- this.impulseGenerator.on('checkDeviceState', async () => {
49
- if (this.call) return;
50
-
51
- try {
52
- this.call = true;
53
- await this.checkDeviceState();
54
- this.call = false;
55
- } catch (error) {
56
- this.call = false;
57
- this.emit('error', `Inpulse generator error: ${error}`);
58
- };
59
- }).on('state', (state) => {
60
- const emitState = state ? this.emit('success', `Impulse generator started`) : this.emit('warn', `Impulse generator stopped`);
61
- });
47
+ this.impulseGenerator = new ImpulseGenerator()
48
+ .on('checkDeviceState', async () => {
49
+ if (this.call) return;
50
+
51
+ try {
52
+ this.call = true;
53
+ await this.checkDeviceState();
54
+ this.call = false;
55
+ } catch (error) {
56
+ this.call = false;
57
+ this.emit('error', `Inpulse generator error: ${error}`);
58
+ };
59
+ })
60
+ .on('state', (state) => {
61
+ this.emit('success', `Impulse generator ${state ? 'started' : 'stopped'}.`);
62
+ });
62
63
  }
63
64
 
64
65
  async checkDeviceState() {
package/src/switches.js CHANGED
@@ -43,21 +43,22 @@ class Switches extends EventEmitter {
43
43
 
44
44
  //impulse generator
45
45
  this.call = false;
46
- this.impulseGenerator = new ImpulseGenerator();
47
- this.impulseGenerator.on('checkDeviceState', async () => {
48
- if (this.call) return;
49
-
50
- try {
51
- this.call = true;
52
- await this.checkDeviceState();
53
- this.call = false;
54
- } catch (error) {
55
- this.call = false;
56
- this.emit('error', `Inpulse generator error: ${error}`);
57
- };
58
- }).on('state', (state) => {
59
- const emitState = state ? this.emit('success', `Impulse generator started`) : this.emit('warn', `Impulse generator stopped`);
60
- });
46
+ this.impulseGenerator = new ImpulseGenerator()
47
+ .on('checkDeviceState', async () => {
48
+ if (this.call) return;
49
+
50
+ try {
51
+ this.call = true;
52
+ await this.checkDeviceState();
53
+ this.call = false;
54
+ } catch (error) {
55
+ this.call = false;
56
+ this.emit('error', `Inpulse generator error: ${error}`);
57
+ };
58
+ })
59
+ .on('state', (state) => {
60
+ this.emit('success', `Impulse generator ${state ? 'started' : 'stopped'}.`);
61
+ });
61
62
  }
62
63
 
63
64
  async checkDeviceState() {