homebridge-tasmota-control 1.5.1-beta.21 → 1.5.1-beta.23
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 +1 -1
- package/src/sensors.js +10 -10
package/package.json
CHANGED
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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`;
|
|
@@ -426,7 +426,7 @@ class Sensors extends EventEmitter {
|
|
|
426
426
|
if (sensor.name === 'ENERGY') {
|
|
427
427
|
const debug4 = this.enableDebugMode ? this.emit('debug', `Prepare Power And Energy Service`) : false;
|
|
428
428
|
this.sensorEnergyServices = [];
|
|
429
|
-
const serviceName = this.sensorsNamePrefix ? `${accessoryName} ${sensorName} Power And Energy` : `${sensorName} Power And Energy`;
|
|
429
|
+
const serviceName = this.sensorsNamePrefix ? `${accessoryName} ${sensorName} Power And Energy` : `${sensorName} Power And Energy ${i}`;
|
|
430
430
|
const energyService = accessory.addService(Service.PowerAndEnergyService, serviceName, 'energyService');
|
|
431
431
|
energyService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
|
|
432
432
|
if (sensor.power) {
|