homebridge-tasmota-control 1.5.1-beta.6 → 1.5.1-beta.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/sensors.js +4 -3
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.6",
4
+ "version": "1.5.1-beta.8",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/sensors.js CHANGED
@@ -75,7 +75,7 @@ class Sensors extends EventEmitter {
75
75
  //sensor status
76
76
  const sensorStatusData = await this.axiosInstance(ApiCommands.Status);
77
77
  const sensorStatus = sensorStatusData.data ?? {};
78
- const debug1 = this.enableDebugMode ? this.emit('debug', `Sensors status: ${JSON.stringify(sensorStatus, null, 2)}`) : false;
78
+ const debug1 = !this.enableDebugMode ? this.emit('debug', `Sensors status: ${JSON.stringify(sensorStatus, null, 2)}`) : false;
79
79
 
80
80
  //sensor status keys
81
81
  const sensorStatusKeys = Object.keys(sensorStatus);
@@ -116,8 +116,9 @@ class Sensors extends EventEmitter {
116
116
  ambientLight: sensorData.Ambient,
117
117
  motion: sensorData.Motion
118
118
  }
119
- obj.tempUnit = obj.tempUnit === 'C' ? '°C' : 'F';
120
-
119
+ if (obj.tempUnit) {
120
+ obj.tempUnit = obj.tempUnit === 'C' ? '°C' : 'F';
121
+ }
121
122
  //energy
122
123
  const obj1 = {
123
124
  energyTotalStartTime: sensorData.TotalStartTime,