homebridge-tasmota-control 1.6.1-beta.5 → 1.6.1-beta.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/sensors.js +3 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "1.6.1-beta.5",
4
+ "version": "1.6.1-beta.6",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/sensors.js CHANGED
@@ -139,10 +139,9 @@ class Sensors extends EventEmitter {
139
139
 
140
140
  //update characteristics
141
141
  const update = (servicesArray, subtype, charName, value) => {
142
- const service = servicesArray?.[i];
143
- const characteristic = service?.Characteristic?.[charName];
144
- if (service?.subtype === subtype && characteristic && Characteristic?.[charName]) {
145
- characteristic.updateCharacteristic(Characteristic[charName], value);
142
+ const service = servicesArray.find(s => s.subtype === subtype);
143
+ if (service && Characteristic[charName]) {
144
+ service.updateCharacteristic(Characteristic[charName], value);
146
145
  }
147
146
  };
148
147