homebridge-tasmota-control 1.5.1-beta.21 → 1.5.1-beta.22

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/sensors.js +9 -9
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "1.5.1-beta.21",
4
+ "version": "1.5.1-beta.22",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/sensors.js CHANGED
@@ -254,7 +254,7 @@ class Sensors extends EventEmitter {
254
254
  let i = 0;
255
255
  for (const sensor of this.sensors) {
256
256
  const sensorName = sensor.name;
257
- if (sensor.temperature !== undefined) {
257
+ if (sensor.temperature) {
258
258
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare Temperature Sensor Services`) : false;
259
259
  this.sensorTemperatureServices = [];
260
260
  const serviceName = this.sensorsNamePrefix ? `${accessoryName} ${sensorName} Temperature` : `${sensorName} Temperature`;
@@ -271,7 +271,7 @@ class Sensors extends EventEmitter {
271
271
  }
272
272
 
273
273
  //reference temperature
274
- if (sensor.referenceTemperature !== undefined) {
274
+ if (sensor.referenceTemperature) {
275
275
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare Reference Temperature Sensor Services`) : false;
276
276
  this.sensorReferenceTemperatureServices = [];
277
277
  const serviceName = this.sensorsNamePrefix ? `${accessoryName} ${sensorName} Reference Temperature` : `${sensorName} Reference Temperature`;
@@ -288,7 +288,7 @@ class Sensors extends EventEmitter {
288
288
  }
289
289
 
290
290
  //object temperature
291
- if (sensor.objTemperature !== undefined) {
291
+ if (sensor.objTemperature) {
292
292
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare Obj Temperature Sensor Services`) : false;
293
293
  this.sensorObjTemperatureServices = [];
294
294
  const serviceName = this.sensorsNamePrefix ? `${accessoryName} ${sensorName} Obj Temperature` : `${sensorName} Obj Temperature`;
@@ -305,7 +305,7 @@ class Sensors extends EventEmitter {
305
305
  }
306
306
 
307
307
  //ambient temperature
308
- if (sensor.ambTemperature !== undefined) {
308
+ if (sensor.ambTemperature) {
309
309
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare Amb Temperature Sensor Services`) : false;
310
310
  this.sensorAmbTemperatureServices = [];
311
311
  const serviceName = this.sensorsNamePrefix ? `${accessoryName} ${sensorName} Amb Temperature` : `${sensorName} Amb Temperature`;
@@ -322,7 +322,7 @@ class Sensors extends EventEmitter {
322
322
  }
323
323
 
324
324
  //dew point temperature
325
- if (sensor.dewPointTemperature !== undefined) {
325
+ if (sensor.dewPointTemperature) {
326
326
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare Dew Point Temperature Sensor Services`) : false;
327
327
  this.sensorDewPointTemperatureServices = [];
328
328
  const serviceName = this.sensorsNamePrefix ? `${accessoryName} ${sensorName} Dew Point` : `${sensorName} Dew Point`;
@@ -339,7 +339,7 @@ class Sensors extends EventEmitter {
339
339
  }
340
340
 
341
341
  //humidity
342
- if (sensor.humidity !== undefined) {
342
+ if (sensor.humidity) {
343
343
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare Humidity Sensor Services`) : false;
344
344
  this.sensorHumidityServices = [];
345
345
  const serviceName = this.sensorsNamePrefix ? `${accessoryName} ${sensorName} Humidity` : `${sensorName} Humidity`;
@@ -360,7 +360,7 @@ class Sensors extends EventEmitter {
360
360
  //gas
361
361
 
362
362
  //carbon dioxyde
363
- if (sensor.carbonDioxyde !== undefined) {
363
+ if (sensor.carbonDioxyde) {
364
364
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare Carbon Dioxyde Sensor Services`) : false;
365
365
  this.sensorCarbonDioxydeServices = [];
366
366
  const serviceName = this.sensorsNamePrefix ? `${accessoryName} ${sensorName} Carbon Dioxyde` : `${sensorName} Carbon Dioxyde`;
@@ -389,7 +389,7 @@ class Sensors extends EventEmitter {
389
389
  }
390
390
 
391
391
  //ambient light
392
- if (sensor.ambientLight !== undefined) {
392
+ if (sensor.ambientLight) {
393
393
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare Ambient Light Sensor Services`) : false;
394
394
  this.sensorAmbientLightServices = [];
395
395
  const serviceName = this.sensorsNamePrefix ? `${accessoryName} ${sensorName} Ambient Light` : `${sensorName} Ambient Light`;
@@ -406,7 +406,7 @@ class Sensors extends EventEmitter {
406
406
  }
407
407
 
408
408
  //motion
409
- if (sensor.motion !== undefined) {
409
+ if (sensor.motion) {
410
410
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare Motion Sensor Services`) : false;
411
411
  this.sensorMotionServices = [];
412
412
  const serviceName = this.sensorsNamePrefix ? `${accessoryName} ${sensorName} Motion` : `${sensorName} Motion`;