homebridge-tasmota-control 1.5.1-beta.0 → 1.5.1-beta.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "1.5.1-beta.0",
4
+ "version": "1.5.1-beta.1",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/deviceinfo.js CHANGED
@@ -55,6 +55,7 @@ class DeviceInfo extends EventEmitter {
55
55
  const statusSns = deviceInfo.StatusSNS ?? {};
56
56
  const statusSnsKeys = Object.keys(statusSns);
57
57
 
58
+
58
59
  //status STS
59
60
  const statusSts = deviceInfo.StatusSTS ?? {};
60
61
  const statusStsKeys = Object.keys(statusSts);
package/src/sensors.js CHANGED
@@ -87,14 +87,14 @@ class Sensors extends EventEmitter {
87
87
  //status SNS
88
88
  if (statusSnsSupported) {
89
89
  this.sensors = [];
90
- const sensor = Object.entries(statusSns)
90
+ const sensorData = Object.entries(statusSns)
91
91
  .filter(([key]) => SensorKeys.some(type => key.includes(type)))
92
92
  .reduce((obj, [key, value]) => {
93
93
  obj[key] = value;
94
94
  return obj;
95
95
  }, {});
96
96
 
97
- for (const [key, value] of Object.entries(sensor)) {
97
+ for (const [key, value] of Object.entries(sensorData)) {
98
98
  const sensorData = value;
99
99
 
100
100
  //sensor
@@ -132,11 +132,11 @@ class Sensors extends EventEmitter {
132
132
  current: sensorData.Current,
133
133
  load: sensorData.Load,
134
134
  }
135
- obj = key === 'ENERGY' ? { ...obj, ...obj1 } : obj;
136
- this.emit('debug', `Sensors status: ${JSON.stringify(obj, null, 2)}`)
135
+ const sensor = key === 'ENERGY' ? { ...obj, ...obj1 } : obj;
136
+ this.emit('debug', `Sensors status: ${JSON.stringify(sensor, null, 2)}`)
137
137
 
138
138
  //push to array
139
- this.sensors.push(obj);
139
+ this.sensors.push(sensor);
140
140
  }
141
141
  this.sensorsCount = this.sensors.length;
142
142