homebridge-tasmota-control 1.8.0-beta.2 → 1.8.0-beta.3

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.8.0-beta.2",
4
+ "version": "1.8.0-beta.3",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/deviceinfo.js CHANGED
@@ -3,11 +3,11 @@ import EventEmitter from 'events';
3
3
  import { ApiCommands, LightKeys, SensorKeys } from './constants.js';
4
4
 
5
5
  class DeviceInfo extends EventEmitter {
6
- constructor(url, auth, user, passwd, deviceName, loadNameFromDevice, enableDebugMode) {
6
+ constructor(url, auth, user, passwd, deviceName, loadNameFromDevice, logDebug) {
7
7
  super();
8
8
  this.name = deviceName
9
9
  this.loadNameFromDevice = loadNameFromDevice;
10
- this.enableDebugMode = enableDebugMode;
10
+ this.logDebug = logDebug;
11
11
 
12
12
  //axios instance
13
13
  this.client = axios.create({
@@ -23,11 +23,11 @@ class DeviceInfo extends EventEmitter {
23
23
  }
24
24
 
25
25
  async getInfo() {
26
- if (this.enableDebugMode) this.emit('debug', `Requesting info`);
26
+ if (this.logDebug) this.emit('debug', `Requesting info`);
27
27
  try {
28
28
  const deviceInfoData = await this.client.get(ApiCommands.Status);
29
29
  const deviceInfo = deviceInfoData.data ?? {};
30
- if (this.enableDebugMode) this.emit('debug', `Info: ${JSON.stringify(deviceInfo, null, 2)}`);
30
+ if (this.logDebug) this.emit('debug', `Info: ${JSON.stringify(deviceInfo, null, 2)}`);
31
31
  await new Promise(resolve => setTimeout(resolve, 250));
32
32
 
33
33
  //status
package/src/fans.js CHANGED
@@ -22,9 +22,9 @@ class Fans extends EventEmitter {
22
22
  //other config
23
23
  this.lightsNamePrefix = config.lightsNamePrefix || false;
24
24
  this.fansNamePrefix = config.fansNamePrefix || false;
25
- this.logDeviceInfo = device.log?.deviceInfo || false;
26
- this.logInfo = device.log?.info || false;
27
- this.logDebug = device.log?.debug || false;
25
+ this.logDeviceInfo = config.log?.deviceInfo || false;
26
+ this.logInfo = config.log?.info || false;
27
+ this.logDebug = config.log?.debug || false;
28
28
  this.functions = new Functions();
29
29
 
30
30
  //axios instance
package/src/lights.js CHANGED
@@ -21,9 +21,9 @@ class Lights extends EventEmitter {
21
21
 
22
22
  //other config
23
23
  this.lightsNamePrefix = config.lightsNamePrefix || false;
24
- this.logDeviceInfo = device.log?.deviceInfo || false;
25
- this.logInfo = device.log?.info || false;
26
- this.logDebug = device.log?.debug || false;
24
+ this.logDeviceInfo = config.log?.deviceInfo || false;
25
+ this.logInfo = config.log?.info || false;
26
+ this.logDebug = config.log?.debug || false;
27
27
  this.functions = new Functions();
28
28
 
29
29
  //axios instance
package/src/mielhvac.js CHANGED
@@ -77,9 +77,9 @@ class MiElHvac extends EventEmitter {
77
77
 
78
78
  //other config
79
79
  this.sensorsNamePrefix = config.sensorsNamePrefix || false;
80
- this.logDeviceInfo = device.log?.deviceInfo || false;
81
- this.logInfo = device.log?.info || false;
82
- this.logDebug = device.log?.debug || false;
80
+ this.logDeviceInfo = config.log?.deviceInfo || false;
81
+ this.logInfo = config.log?.info || false;
82
+ this.logDebug = config.log?.debug || false;
83
83
 
84
84
  //mielhvac
85
85
  this.mielHvac = {};
package/src/sensors.js CHANGED
@@ -20,9 +20,9 @@ class Sensors extends EventEmitter {
20
20
 
21
21
  //other config
22
22
  this.sensorsNamePrefix = config.sensorsNamePrefix || false;
23
- this.logDeviceInfo = device.log?.deviceInfo || false;
24
- this.logInfo = device.log?.info || false;
25
- this.logDebug = device.log?.debug || false;
23
+ this.logDeviceInfo = config.log?.deviceInfo || false;
24
+ this.logInfo = config.log?.info || false;
25
+ this.logDebug = config.log?.debug || false;
26
26
  this.functions = new Functions();
27
27
 
28
28
  //sensors
package/src/switches.js CHANGED
@@ -22,9 +22,9 @@ class Switches extends EventEmitter {
22
22
  //other config
23
23
  this.relaysDisplayType = config.relaysDisplayType || 0;
24
24
  this.relaysNamePrefix = config.relaysNamePrefix || false;
25
- this.logDeviceInfo = device.log?.deviceInfo || false;
26
- this.logInfo = device.log?.info || false;
27
- this.logDebug = device.log?.debug || false;
25
+ this.logDeviceInfo = config.log?.deviceInfo || false;
26
+ this.logInfo = config.log?.info || false;
27
+ this.logDebug = config.log?.debug || false;
28
28
  this.functions = new Functions();
29
29
 
30
30
  //axios instance