homebridge-tasmota-control 1.0.1 → 1.0.3
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/tasmotadevice.js +4 -4
package/package.json
CHANGED
package/src/tasmotadevice.js
CHANGED
|
@@ -70,7 +70,7 @@ class TasmotaDevice extends EventEmitter {
|
|
|
70
70
|
const buttonDisplayType = button.displayType ?? 0;
|
|
71
71
|
const buttonNamePrefix = button.namePrefix ?? false;
|
|
72
72
|
if (buttonName && buttonMode >= 0 && buttonDisplayType > 0) {
|
|
73
|
-
const buttonServiceType = ['', Service.Outlet, Service.Switch
|
|
73
|
+
const buttonServiceType = ['', Service.Outlet, Service.Switch][buttonDisplayType];
|
|
74
74
|
const buttonCharacteristicType = ['', Characteristic.On, Characteristic.On][buttonDisplayType];
|
|
75
75
|
button.namePrefix = buttonNamePrefix;
|
|
76
76
|
button.serviceType = buttonServiceType;
|
|
@@ -93,7 +93,7 @@ class TasmotaDevice extends EventEmitter {
|
|
|
93
93
|
const sensorDisplayType = sensor.displayType ?? 0;
|
|
94
94
|
const sensorNamePrefix = sensor.namePrefix ?? false;
|
|
95
95
|
if (sensorName && sensorMode >= 0 && sensorDisplayType > 0) {
|
|
96
|
-
const sensorServiceType = ['', Service.
|
|
96
|
+
const sensorServiceType = ['', Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensorDisplayType];
|
|
97
97
|
const sensorCharacteristicType = ['', Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensorDisplayType];
|
|
98
98
|
sensor.namePrefix = sensorNamePrefix;
|
|
99
99
|
sensor.serviceType = sensorServiceType;
|
|
@@ -105,7 +105,7 @@ class TasmotaDevice extends EventEmitter {
|
|
|
105
105
|
const log = sensorDisplayType === 0 ? false : this.emit('warn', `Sensor Name: ${sensorName ? sensorName : 'Missing'}, Mode: ${sensorMode ? sensorMode : 'Missing'}.`);
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
this.
|
|
108
|
+
this.sensorsConfiguredCount = this.sensorsConfigured.length || 0;
|
|
109
109
|
|
|
110
110
|
//frost protect
|
|
111
111
|
const frostProtect = miElHvac.frostProtect ?? {};
|
|
@@ -1635,7 +1635,7 @@ class TasmotaDevice extends EventEmitter {
|
|
|
1635
1635
|
const serviceName = sensorNamePrefix ? `${accessoryName} ${sensorName}` : sensorName;
|
|
1636
1636
|
const serviceType = sensor.serviceType;
|
|
1637
1637
|
const characteristicType = sensor.characteristicType;
|
|
1638
|
-
const sensorService = new serviceType(serviceName, `
|
|
1638
|
+
const sensorService = new serviceType(serviceName, `Sensor ${i}`);
|
|
1639
1639
|
sensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1640
1640
|
sensorService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
|
|
1641
1641
|
sensorService.getCharacteristic(characteristicType)
|