homebridge-tasmota-control 1.5.1-beta.11 → 1.5.1-beta.12

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.11",
4
+ "version": "1.5.1-beta.12",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/deviceinfo.js CHANGED
@@ -54,11 +54,6 @@ class DeviceInfo extends EventEmitter {
54
54
  //status SNS
55
55
  const statusSns = deviceInfo.StatusSNS ?? {};
56
56
  const statusSnsKeys = Object.keys(statusSns);
57
- const sensorName = Object.entries(statusSns)
58
- .filter(([key]) => SensorKeys.some(type => key.includes(type)))
59
- .reduce((obj, [key, value]) => {
60
- return key;
61
- }, {});
62
57
 
63
58
  //status STS
64
59
  const statusSts = deviceInfo.StatusSTS ?? {};
@@ -71,6 +66,11 @@ class DeviceInfo extends EventEmitter {
71
66
  const fans = statusStsKeys.includes('FanSpeed') ? types.push(3) : false;
72
67
  const switches = !mielhvac && !lights && !fans ? types.push(1) : false
73
68
  const sensors = statusSnsKeys.some(key => SensorKeys.includes(key)) ? types.push(4) : false;
69
+ const sensorName = Object.entries(statusSns)
70
+ .filter(([key]) => SensorKeys.some(type => key.includes(type)))
71
+ .reduce((obj, [key, value]) => {
72
+ return key;
73
+ }, {});
74
74
  const obj = {
75
75
  deviceTypes: types,
76
76
  deviceName: deviceName,
package/src/sensors.js CHANGED
@@ -100,9 +100,9 @@ class Sensors extends EventEmitter {
100
100
  //sensor
101
101
  const obj = {
102
102
  name: key,
103
- time: sensorStatus.Time,
104
- tempUnit: sensorStatus.TempUnit,
105
- pressureUnit: sensorStatus.PressureUnit,
103
+ time: statusSns.Time,
104
+ tempUnit: statusSns.TempUnit,
105
+ pressureUnit: statusSns.PressureUnit,
106
106
  temperature: sensorData.Temperature,
107
107
  referenceTemperature: sensorData.ReferenceTemperature,
108
108
  objTemperature: sensorData.OBJTMP,