homebridge-tasmota-control 1.5.1-beta.5 → 1.5.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.
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.5",
4
+ "version": "1.5.1-beta.6",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/deviceinfo.js CHANGED
@@ -54,13 +54,11 @@ class DeviceInfo extends EventEmitter {
54
54
  //status SNS
55
55
  const statusSns = deviceInfo.StatusSNS ?? {};
56
56
  const statusSnsKeys = Object.keys(statusSns);
57
- const sensor = Object.entries(statusSns)
57
+ const sensorName = Object.entries(statusSns)
58
58
  .filter(([key]) => SensorKeys.some(type => key.includes(type)))
59
59
  .reduce((obj, [key, value]) => {
60
- obj[key] = value;
61
- return obj;
60
+ return key;
62
61
  }, {});
63
- this.emit('debug', `Sensor: ${JSON.stringify(sensor, null, 2)}`)
64
62
 
65
63
  //status STS
66
64
  const statusSts = deviceInfo.StatusSTS ?? {};
@@ -76,12 +74,13 @@ class DeviceInfo extends EventEmitter {
76
74
  const obj = {
77
75
  deviceTypes: types,
78
76
  deviceName: deviceName,
79
- sensorName: deviceName,
77
+ sensorName: sensorName,
80
78
  friendlyNames: friendlyNames,
81
79
  modelName: modelName,
82
80
  serialNumber: addressMac,
83
81
  firmwareRevision: firmwareRevision
84
82
  };
83
+ this.emit('debug', `Sensor: ${JSON.stringify(obj, null, 2)}`)
85
84
  return obj;
86
85
  } catch (error) {
87
86
  throw new Error(`Check info error: ${error}`);