homebridge-tasmota-control 1.6.2-beta.11 → 1.6.2-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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/sensors.js +4 -8
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "1.6.2-beta.11",
4
+ "version": "1.6.2-beta.12",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/sensors.js CHANGED
@@ -149,7 +149,7 @@ class Sensors extends EventEmitter {
149
149
  try {
150
150
  service?.getCharacteristic(charType)?.updateValue(value);
151
151
  } catch (err) {
152
- this.emit?.('warn', `Failed to update ${charType.displayName}: ${err.message}`);
152
+ this.emit?.('warn', `Failed to update ${charType}: ${err.message}`);
153
153
  }
154
154
  }
155
155
 
@@ -175,19 +175,15 @@ class Sensors extends EventEmitter {
175
175
  energyMap.forEach(([charType, value]) => {
176
176
  try {
177
177
  energyService?.getCharacteristic(charType)?.updateValue(value);
178
- this.emit?.('debug', `Updated ${charType.displayName}: ${value}`);
178
+ this.emit?.('debug', `Updated ${charType}: ${value}`);
179
179
  } catch (err) {
180
- this.emit?.('warn', `Failed to update ${charType.displayName}: ${err.message}`);
180
+ this.emit?.('warn', `Failed to update ${charType}: ${err.message}`);
181
181
  }
182
182
  });
183
183
 
184
184
  this.emit('warn', `Power: ${JSON.stringify(obj, null, 2)}`);
185
185
  }
186
-
187
- if (this.enableDebugMode) {
188
- this.emit('debug', `Sensor: ${JSON.stringify(obj, null, 2)}`);
189
- }
190
-
186
+ const debug1 = this.enableDebugMode ? this.emit('debug', `Sensor: ${JSON.stringify(obj, null, 2)}`) : false;
191
187
  i++;
192
188
  }
193
189