homebridge-tasmota-control 1.5.1-beta.1 → 1.5.1-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "1.5.1-beta.1",
4
+ "version": "1.5.1-beta.2",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/deviceinfo.js CHANGED
@@ -54,7 +54,13 @@ class DeviceInfo extends EventEmitter {
54
54
  //status SNS
55
55
  const statusSns = deviceInfo.StatusSNS ?? {};
56
56
  const statusSnsKeys = Object.keys(statusSns);
57
-
57
+ const sensor = Object.entries(statusSns)
58
+ .filter(([key]) => SensorKeys.some(type => key.includes(type)))
59
+ .reduce((obj, [key, value]) => {
60
+ obj[key] = value;
61
+ return obj;
62
+ }, {});
63
+ this.emit('debug', `Sensor: ${JSON.stringify(sensor, null, 2)}`)
58
64
 
59
65
  //status STS
60
66
  const statusSts = deviceInfo.StatusSTS ?? {};
package/src/sensors.js CHANGED
@@ -114,7 +114,7 @@ class Sensors extends EventEmitter {
114
114
  gas: sensorData.Gas,
115
115
  carbonDioxyde: sensorData.CarbonDioxyde,
116
116
  ambientLight: sensorData.Ambient,
117
- motion: sensorData.Motion === 'ON',
117
+ motion: sensorData.Motion ? sensorData.Motion === 'ON' : null
118
118
  }
119
119
 
120
120
  //energy