homebridge-tasmota-control 0.10.13 → 0.10.14
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 +6 -5
package/package.json
CHANGED
package/src/tasmotadevice.js
CHANGED
|
@@ -103,7 +103,7 @@ class TasmotaDevice extends EventEmitter {
|
|
|
103
103
|
|
|
104
104
|
try {
|
|
105
105
|
const deviceInfoData = await this.axiosInstance(CONSTANS.ApiCommands.Status);
|
|
106
|
-
const deviceInfo = deviceInfoData.data;
|
|
106
|
+
const deviceInfo = deviceInfoData.data ?? {};
|
|
107
107
|
const debug = this.enableDebugMode ? this.emit('debug', `Info: ${JSON.stringify(deviceInfo, null, 2)}`) : false;
|
|
108
108
|
|
|
109
109
|
//keys
|
|
@@ -120,8 +120,9 @@ class TasmotaDevice extends EventEmitter {
|
|
|
120
120
|
|
|
121
121
|
//status fwr
|
|
122
122
|
const statusFWRSupported = deviceInfoKeys.includes('StatusFWR');
|
|
123
|
-
const
|
|
124
|
-
const
|
|
123
|
+
const statusFwr = deviceInfo.StatusFWR ?? {};
|
|
124
|
+
const firmwareRevision = statusFwr.Version ?? 'Unknown';
|
|
125
|
+
const modelName = statusFwr.Hardware ?? 'Unknown';
|
|
125
126
|
|
|
126
127
|
//status net
|
|
127
128
|
const addressMac = deviceInfo.StatusNET.Mac;
|
|
@@ -199,7 +200,7 @@ class TasmotaDevice extends EventEmitter {
|
|
|
199
200
|
for (let i = 0; i < relaysCount; i++) {
|
|
200
201
|
const powerNr = i + 1;
|
|
201
202
|
const powerKey = relaysCount === 1 ? 'POWER' : `POWER${powerNr}`;
|
|
202
|
-
const powerState = powersStatus[powerKey] === 'ON'
|
|
203
|
+
const powerState = powersStatus[powerKey] === 'ON';
|
|
203
204
|
const brightness = powersStatus.Dimmer ?? false;
|
|
204
205
|
const colorTemperature = powersStatus.CT ?? false;
|
|
205
206
|
const hue = powersStatus.HSBColor1 ?? false;
|
|
@@ -270,7 +271,7 @@ class TasmotaDevice extends EventEmitter {
|
|
|
270
271
|
const gas = sensorData.Gas ?? false;
|
|
271
272
|
const carbonDioxyde = sensorData.CarbonDioxyde ?? false;
|
|
272
273
|
const ambientLight = sensorData.Ambient ?? false;
|
|
273
|
-
const motion = sensorData === 'ON'
|
|
274
|
+
const motion = sensorData === 'ON';
|
|
274
275
|
|
|
275
276
|
//energy
|
|
276
277
|
const energyTotal = sensorData.Total ?? false;
|