homebridge-tasmota-control 0.7.2-beta.1 → 0.7.2-beta.2
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/tasmotadevice.js +16 -15
package/package.json
CHANGED
package/src/tasmotadevice.js
CHANGED
|
@@ -126,22 +126,23 @@ class TasmotaDevice {
|
|
|
126
126
|
const addressMac = deviceInfo.StatusNET.Mac;
|
|
127
127
|
|
|
128
128
|
//status sns
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
129
|
+
const statusSNSSupported = deviceInfoKeys.includes('StatusSNS') ?? false;
|
|
130
|
+
if (statusSNSSupported) {
|
|
131
|
+
const sensorTypes = CONSTANS.StatusSNS;
|
|
132
|
+
const sensor = Object.entries(deviceInfo.StatusSNS)
|
|
133
|
+
.filter(([key]) => sensorTypes.some(type => key.includes(type)))
|
|
134
|
+
.reduce((obj, [key, value]) => {
|
|
135
|
+
obj[key] = value;
|
|
136
|
+
return obj;
|
|
137
|
+
}, {});
|
|
138
|
+
|
|
139
|
+
for (const [key, value] of Object.entries(sensor)) {
|
|
140
|
+
const obj = {
|
|
141
|
+
'name': key,
|
|
142
|
+
'data': value
|
|
143
|
+
}
|
|
144
|
+
this.sensors.push(obj);
|
|
143
145
|
}
|
|
144
|
-
this.sensors.push(obj);
|
|
145
146
|
}
|
|
146
147
|
const sensorsCount = this.sensors.length;
|
|
147
148
|
|