homebridge-tasmota-control 0.7.2-beta.2 → 0.8.0

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/README.md CHANGED
@@ -33,6 +33,8 @@ Homebridge plugin for Tasmota flashed devices.
33
33
  * Temperature
34
34
  * Humidity
35
35
  * Dew Point
36
+ * Carbon Dioxyde
37
+ * Ambient Light
36
38
 
37
39
  ### Configuration
38
40
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "0.7.2-beta.2",
4
+ "version": "0.8.0",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/constans.json CHANGED
@@ -40,6 +40,8 @@
40
40
  "Humidity",
41
41
  "DewPoint",
42
42
  "Pressure",
43
- "Gas"
43
+ "Gas",
44
+ "CarbonDioxyde",
45
+ "Ambient"
44
46
  ]
45
47
  }
@@ -417,7 +417,7 @@ class TasmotaDevice {
417
417
  sensorDewPointService.getCharacteristic(Characteristic.CurrentTemperature)
418
418
  .onGet(async () => {
419
419
  const value = this.sensorsDewPoint[i];
420
- const logInfo = this.disableLogInfo ? false : this.log(`Device: ${this.host}, ${accessoryName}, sensor:${sensorName} dew point: ${value} °${this.tempUnit}`);
420
+ const logInfo = this.disableLogInfo ? false : this.log(`Device: ${this.host}, ${accessoryName}, sensor: ${sensorName} dew point: ${value} °${this.tempUnit}`);
421
421
  return value;
422
422
  });
423
423
  this.sensorDewPointServices.push(sensorDewPointService);
@@ -443,48 +443,48 @@ class TasmotaDevice {
443
443
  sensorCarbonDioxydeService.getCharacteristic(Characteristic.CarbonDioxideDetected)
444
444
  .onGet(async () => {
445
445
  const state = this.sensorsCarbonDioxyde[i] > 1000;
446
- const logInfo = this.disableLogInfo ? false : this.log(`Device: ${this.host}, ${accessoryName}, sensor:${sensorName} carbon dioxyde detected: ${state ? 'Yes' : 'No'}`);
446
+ const logInfo = this.disableLogInfo ? false : this.log(`Device: ${this.host}, ${accessoryName}, sensor: ${sensorName} carbon dioxyde detected: ${state ? 'Yes' : 'No'}`);
447
447
  return state;
448
448
  });
449
449
  sensorCarbonDioxydeService.getCharacteristic(Characteristic.CarbonDioxideLevel)
450
450
  .onGet(async () => {
451
451
  const value = this.sensorsCarbonDioxyde[i];
452
- const logInfo = this.disableLogInfo ? false : this.log(`Device: ${this.host}, ${accessoryName}, sensor:${sensorName} carbon dioxyde level: ${value} ppm`);
452
+ const logInfo = this.disableLogInfo ? false : this.log(`Device: ${this.host}, ${accessoryName}, sensor: ${sensorName} carbon dioxyde level: ${value} ppm`);
453
453
  return value;
454
454
  });
455
455
  sensorCarbonDioxydeService.getCharacteristic(Characteristic.CarbonDioxidePeakLevel)
456
456
  .onGet(async () => {
457
457
  const value = this.sensorsCarbonDioxyde[i];
458
- const logInfo = this.disableLogInfo ? false : this.log(`Device: ${this.host}, ${accessoryName}, sensor:${sensorName} carbon dioxyde peak level: ${value} ppm`);
458
+ const logInfo = this.disableLogInfo ? false : this.log(`Device: ${this.host}, ${accessoryName}, sensor: ${sensorName} carbon dioxyde peak level: ${value} ppm`);
459
459
  return value;
460
460
  });
461
461
  this.sensorCarbonDioxydeServices.push(sensorCarbonDioxydeService);
462
462
  accessory.addService(sensorCarbonDioxydeService);
463
463
  };
464
464
  }
465
- };
466
465
 
467
- //ambient light
468
- const sensorsAmbientLightCount = this.sensorsAmbientLightCount;
469
- if (sensorsAmbientLightCount > 0) {
470
- const debug = this.enableDebugMode ? this.log('Prepare Ambient Light Sensor Services') : false;
471
- this.sensorAmbientLightServices = [];
472
- for (let i = 0; i < sensorsAmbientLightCount; i++) {
473
- const sensorName = this.sensorsName[i];
474
- const serviceName = `${accessoryName} ${sensorName} Ambient Light`;
475
- const sensorAmbientLightService = new Service.LightSensor(serviceName, `Ambient Light Sensor${i}`);
476
- sensorAmbientLightService.addOptionalCharacteristic(Characteristic.ConfiguredName);
477
- sensorAmbientLightService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
478
- sensorAmbientLightService.getCharacteristic(Characteristic.CurrentAmbientLightLevel)
479
- .onGet(async () => {
480
- const value = this.sensorsAmbientLight[i];
481
- const logInfo = this.disableLogInfo ? false : this.log(`Device: ${this.host}, ${accessoryName}, sensor:${sensorName} ambient light: ${value} lx`);
482
- return value;
483
- });
484
- this.sensorAmbientLightServices.push(sensorAmbientLightService);
485
- accessory.addService(sensorAmbientLightService);
486
- };
487
- }
466
+ //ambient light
467
+ const sensorsAmbientLightCount = this.sensorsAmbientLightCount;
468
+ if (sensorsAmbientLightCount > 0) {
469
+ const debug = this.enableDebugMode ? this.log('Prepare Ambient Light Sensor Services') : false;
470
+ this.sensorAmbientLightServices = [];
471
+ for (let i = 0; i < sensorsAmbientLightCount; i++) {
472
+ const sensorName = this.sensorsName[i];
473
+ const serviceName = `${accessoryName} ${sensorName} Ambient Light`;
474
+ const sensorAmbientLightService = new Service.LightSensor(serviceName, `Ambient Light Sensor${i}`);
475
+ sensorAmbientLightService.addOptionalCharacteristic(Characteristic.ConfiguredName);
476
+ sensorAmbientLightService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
477
+ sensorAmbientLightService.getCharacteristic(Characteristic.CurrentAmbientLightLevel)
478
+ .onGet(async () => {
479
+ const value = this.sensorsAmbientLight[i];
480
+ const logInfo = this.disableLogInfo ? false : this.log(`Device: ${this.host}, ${accessoryName}, sensor: ${sensorName} ambient light: ${value} lx`);
481
+ return value;
482
+ });
483
+ this.sensorAmbientLightServices.push(sensorAmbientLightService);
484
+ accessory.addService(sensorAmbientLightService);
485
+ };
486
+ }
487
+ };
488
488
 
489
489
  resolve(accessory);
490
490
  } catch (error) {