homebridge-tasmota-control 1.6.1-beta.7 → 1.6.1-beta.8
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 +1 -2
package/package.json
CHANGED
package/src/sensors.js
CHANGED
|
@@ -134,12 +134,11 @@ class Sensors extends EventEmitter {
|
|
|
134
134
|
|
|
135
135
|
const sensor = key === 'ENERGY' ? { ...obj, ...energy } : obj;
|
|
136
136
|
const debug1 = this.enableDebugMode ? this.emit('debug', `Sensor: ${JSON.stringify(sensor, null, 2)}`) : false;
|
|
137
|
-
|
|
138
137
|
this.sensors.push(sensor);
|
|
139
138
|
|
|
140
139
|
//update characteristics
|
|
141
140
|
const update = (servicesArray, subtype, charName, value) => {
|
|
142
|
-
const service = servicesArray[i].find(s => s.subtype === subtype);
|
|
141
|
+
const service = servicesArray?.[i].find(s => s.subtype === subtype);
|
|
143
142
|
if (service && Characteristic[charName]) {
|
|
144
143
|
service.updateCharacteristic(Characteristic[charName], value);
|
|
145
144
|
}
|