homebridge-tasmota-control 1.5.1-beta.4 → 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.4",
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,11 +74,13 @@ class DeviceInfo extends EventEmitter {
76
74
  const obj = {
77
75
  deviceTypes: types,
78
76
  deviceName: deviceName,
77
+ sensorName: sensorName,
79
78
  friendlyNames: friendlyNames,
80
79
  modelName: modelName,
81
80
  serialNumber: addressMac,
82
81
  firmwareRevision: firmwareRevision
83
82
  };
83
+ this.emit('debug', `Sensor: ${JSON.stringify(obj, null, 2)}`)
84
84
  return obj;
85
85
  } catch (error) {
86
86
  throw new Error(`Check info error: ${error}`);
package/src/sensors.js CHANGED
@@ -101,8 +101,8 @@ class Sensors extends EventEmitter {
101
101
  const obj = {
102
102
  name: key,
103
103
  time: sensorStatus.Time,
104
- tempUnit: sensorStatus.TempUnit === 'C' ? '°C' : 'F',
105
- pressureUnit: sensorStatus.PressureUnit ?? 'hPa',
104
+ tempUnit: sensorStatus.TempUnit,
105
+ pressureUnit: sensorStatus.PressureUnit,
106
106
 
107
107
  temperature: sensorData.Temperature,
108
108
  referenceTemperature: sensorData.ReferenceTemperature,
@@ -116,6 +116,7 @@ class Sensors extends EventEmitter {
116
116
  ambientLight: sensorData.Ambient,
117
117
  motion: sensorData.Motion
118
118
  }
119
+ obj.tempUnit = obj.tempUnit === 'C' ? '°C' : 'F';
119
120
 
120
121
  //energy
121
122
  const obj1 = {