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 +1 -1
- package/src/deviceinfo.js +4 -5
package/package.json
CHANGED
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
|
|
57
|
+
const sensorName = Object.entries(statusSns)
|
|
58
58
|
.filter(([key]) => SensorKeys.some(type => key.includes(type)))
|
|
59
59
|
.reduce((obj, [key, value]) => {
|
|
60
|
-
|
|
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:
|
|
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}`);
|