homebridge-tasmota-control 1.5.0 → 1.5.1-beta.0
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/index.js +1 -1
- package/package.json +1 -1
- package/src/sensors.js +24 -18
package/index.js
CHANGED
|
@@ -144,7 +144,7 @@ class tasmotaPlatform {
|
|
|
144
144
|
const emitLog = disableLogInfo ? false : log.info(`Device: ${host} ${deviceName}, ${info}.`);
|
|
145
145
|
})
|
|
146
146
|
.on('debug', (debug) => {
|
|
147
|
-
const emitLog =
|
|
147
|
+
const emitLog = enableDebugMode ? false : log.info(`Device: ${host} ${deviceName}, debug: ${debug}.`);
|
|
148
148
|
})
|
|
149
149
|
.on('warn', (warn) => {
|
|
150
150
|
const emitLog = disableLogWarn ? false : log.warn(`Device: ${host} ${deviceName}, ${warn}.`);
|
package/package.json
CHANGED
package/src/sensors.js
CHANGED
|
@@ -99,7 +99,11 @@ class Sensors extends EventEmitter {
|
|
|
99
99
|
|
|
100
100
|
//sensor
|
|
101
101
|
const obj = {
|
|
102
|
-
name: key
|
|
102
|
+
name: key,
|
|
103
|
+
time: sensorStatus.Time,
|
|
104
|
+
tempUnit: sensorStatus.TempUnit === 'C' ? '°C' : 'F',
|
|
105
|
+
pressureUnit: sensorStatus.PressureUnit ?? 'hPa',
|
|
106
|
+
|
|
103
107
|
temperature: sensorData.Temperature,
|
|
104
108
|
referenceTemperature: sensorData.ReferenceTemperature,
|
|
105
109
|
objTemperature: sensorData.OBJTMP,
|
|
@@ -110,24 +114,26 @@ class Sensors extends EventEmitter {
|
|
|
110
114
|
gas: sensorData.Gas,
|
|
111
115
|
carbonDioxyde: sensorData.CarbonDioxyde,
|
|
112
116
|
ambientLight: sensorData.Ambient,
|
|
113
|
-
motion: sensorData === 'ON',
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
117
|
+
motion: sensorData.Motion === 'ON',
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
//energy
|
|
121
|
+
const obj1 = {
|
|
122
|
+
energyTotalStartTime: sensorData.TotalStartTime,
|
|
123
|
+
energyTotal: sensorData.Total,
|
|
124
|
+
energyPeriod: sensorData.Period,
|
|
125
|
+
energyYesterday: sensorData.Yesterday,
|
|
126
|
+
energyToday: sensorData.Today,
|
|
127
|
+
power: sensorData.Power,
|
|
128
|
+
apparentPower: sensorData.ApparentPower,
|
|
129
|
+
reactivePower: sensorData.ReactivePower,
|
|
130
|
+
factor: sensorData.Factor,
|
|
131
|
+
voltage: sensorData.Voltage,
|
|
132
|
+
current: sensorData.Current,
|
|
133
|
+
load: sensorData.Load,
|
|
130
134
|
}
|
|
135
|
+
obj = key === 'ENERGY' ? { ...obj, ...obj1 } : obj;
|
|
136
|
+
this.emit('debug', `Sensors status: ${JSON.stringify(obj, null, 2)}`)
|
|
131
137
|
|
|
132
138
|
//push to array
|
|
133
139
|
this.sensors.push(obj);
|