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 +1 -1
- package/src/deviceinfo.js +4 -4
- package/src/fans.js +3 -3
- package/src/lights.js +3 -3
- package/src/mielhvac.js +3 -3
- package/src/sensors.js +3 -3
- package/src/switches.js +3 -3
package/package.json
CHANGED
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,
|
|
6
|
+
constructor(url, auth, user, passwd, deviceName, loadNameFromDevice, logDebug) {
|
|
7
7
|
super();
|
|
8
8
|
this.name = deviceName
|
|
9
9
|
this.loadNameFromDevice = loadNameFromDevice;
|
|
10
|
-
this.
|
|
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.
|
|
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.
|
|
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 =
|
|
26
|
-
this.logInfo =
|
|
27
|
-
this.logDebug =
|
|
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 =
|
|
25
|
-
this.logInfo =
|
|
26
|
-
this.logDebug =
|
|
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 =
|
|
81
|
-
this.logInfo =
|
|
82
|
-
this.logDebug =
|
|
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 =
|
|
24
|
-
this.logInfo =
|
|
25
|
-
this.logDebug =
|
|
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 =
|
|
26
|
-
this.logInfo =
|
|
27
|
-
this.logDebug =
|
|
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
|