homebridge-tasmota-control 1.6.3-beta.7 → 1.6.3-beta.9
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/fans.js +8 -5
- package/src/lights.js +8 -6
- package/src/sensors.js +2 -2
- package/src/switches.js +3 -2
package/package.json
CHANGED
package/src/fans.js
CHANGED
|
@@ -101,8 +101,9 @@ class Fans extends EventEmitter {
|
|
|
101
101
|
this.lights.push(light);
|
|
102
102
|
|
|
103
103
|
//update characteristics
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
const lightService = this.lightServices?.[i];
|
|
105
|
+
if (lightService) {
|
|
106
|
+
lightService.updateCharacteristic(Characteristic.On, power);
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
//fan
|
|
@@ -119,12 +120,14 @@ class Fans extends EventEmitter {
|
|
|
119
120
|
this.fans.push(fan);
|
|
120
121
|
|
|
121
122
|
//update characteristics
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
const fanService = this.fanServices?.[i];
|
|
124
|
+
if (fanService) {
|
|
125
|
+
fanService.updateCharacteristic(Characteristic.On, powerFan)
|
|
126
|
+
// .updateCharacteristic(Characteristic.Direction, direction)
|
|
125
127
|
.updateCharacteristic(Characteristic.RotationSpeed, speed);
|
|
126
128
|
}
|
|
127
129
|
|
|
130
|
+
|
|
128
131
|
//log info
|
|
129
132
|
if (!this.disableLogInfo) {
|
|
130
133
|
this.emit('info', `${friendlyName}, light: ${power ? 'ON' : 'OFF'}`);
|
package/src/lights.js
CHANGED
|
@@ -118,23 +118,25 @@ class Lights extends EventEmitter {
|
|
|
118
118
|
this.lights.push(light);
|
|
119
119
|
|
|
120
120
|
//update characteristics
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
const service = this.lightServices?.[i];
|
|
122
|
+
if (service) {
|
|
123
|
+
service.updateCharacteristic(Characteristic.On, power);
|
|
123
124
|
|
|
124
125
|
if (brightnessType > 0) {
|
|
125
|
-
|
|
126
|
+
service.updateCharacteristic(Characteristic.Brightness, bright);
|
|
126
127
|
}
|
|
127
128
|
if (colorTemperature !== false) {
|
|
128
|
-
|
|
129
|
+
service.updateCharacteristic(Characteristic.ColorTemperature, colorTemperature);
|
|
129
130
|
}
|
|
130
131
|
if (hue !== false) {
|
|
131
|
-
|
|
132
|
+
service.updateCharacteristic(Characteristic.Hue, hue);
|
|
132
133
|
}
|
|
133
134
|
if (saturation !== false) {
|
|
134
|
-
|
|
135
|
+
service.updateCharacteristic(Characteristic.Saturation, saturation);
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
138
|
|
|
139
|
+
|
|
138
140
|
//log info
|
|
139
141
|
if (!this.disableLogInfo) {
|
|
140
142
|
this.emit('info', `${friendlyName}, state: ${power ? 'ON' : 'OFF'}`);
|
package/src/sensors.js
CHANGED
|
@@ -156,7 +156,7 @@ class Sensors extends EventEmitter {
|
|
|
156
156
|
if (!characteristic) {
|
|
157
157
|
continue;
|
|
158
158
|
}
|
|
159
|
-
service
|
|
159
|
+
service.updateCharacteristic(charType, value);
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
// energy
|
|
@@ -180,7 +180,7 @@ class Sensors extends EventEmitter {
|
|
|
180
180
|
if (!characteristic) {
|
|
181
181
|
continue;
|
|
182
182
|
}
|
|
183
|
-
service
|
|
183
|
+
service.updateCharacteristic(charType, value);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
|
package/src/switches.js
CHANGED
|
@@ -84,8 +84,9 @@ class Switches extends EventEmitter {
|
|
|
84
84
|
this.switchesOutlets.push(switchOutlet);
|
|
85
85
|
|
|
86
86
|
//update characteristics
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
const service = this.lightServices?.[i];
|
|
88
|
+
if (service) {
|
|
89
|
+
service.updateCharacteristic(Characteristic.On, power);
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
//log info
|