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 +2 -0
- package/package.json +1 -1
- package/src/constans.json +3 -1
- package/src/tasmotadevice.js +26 -26
package/README.md
CHANGED
package/package.json
CHANGED
package/src/constans.json
CHANGED
package/src/tasmotadevice.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
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) {
|