homebridge-tasmota-control 1.5.1-beta.15 → 1.5.1-beta.17
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/index.js +6 -3
- package/package.json +1 -1
- package/src/sensors.js +2 -2
package/index.js
CHANGED
|
@@ -56,7 +56,7 @@ class tasmotaPlatform {
|
|
|
56
56
|
const disableLogSuccess = device.disableLogSuccess || false;
|
|
57
57
|
const disableLogWarn = device.disableLogWarn || false;
|
|
58
58
|
const disableLogError = device.disableLogError || false;
|
|
59
|
-
const debug = enableDebugMode ? log.info(`Device: ${host} ${deviceName}, debug: Did finish launching.`)
|
|
59
|
+
const debug = !enableDebugMode ? false : log.info(`Device: ${host} ${deviceName}, debug: Did finish launching.`);
|
|
60
60
|
const newConfig = {
|
|
61
61
|
...device,
|
|
62
62
|
user: 'removed',
|
|
@@ -71,7 +71,7 @@ class tasmotaPlatform {
|
|
|
71
71
|
const emitLog = !enableDebugMode ? false : log.info(`Device: ${host} ${deviceName}, debug: ${debug}.`);
|
|
72
72
|
})
|
|
73
73
|
.on('debug', (debug) => {
|
|
74
|
-
const emitLog = enableDebugMode ? false : log.info(`Device: ${host} ${deviceName}, debug: ${debug}.`);
|
|
74
|
+
const emitLog = !enableDebugMode ? false : log.info(`Device: ${host} ${deviceName}, debug: ${debug}.`);
|
|
75
75
|
})
|
|
76
76
|
.on('warn', (warn) => {
|
|
77
77
|
const emitLog = disableLogWarn ? false : log.warn(`Device: ${host} ${deviceName}, ${warn}.`);
|
|
@@ -89,6 +89,9 @@ class tasmotaPlatform {
|
|
|
89
89
|
let i = 0;
|
|
90
90
|
for (const type of info.deviceTypes) {
|
|
91
91
|
const serialNumber = i === 0 ? info.serialNumber : `${info.serialNumber}${i}`;
|
|
92
|
+
if (type === 4 && info.sensorName === 'ENERGY') {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
92
95
|
|
|
93
96
|
let deviceType;
|
|
94
97
|
switch (type) {
|
|
@@ -147,7 +150,7 @@ class tasmotaPlatform {
|
|
|
147
150
|
const emitLog = disableLogInfo ? false : log.info(`Device: ${host} ${deviceName}, ${info}.`);
|
|
148
151
|
})
|
|
149
152
|
.on('debug', (debug) => {
|
|
150
|
-
const emitLog = enableDebugMode ? false : log.info(`Device: ${host} ${deviceName}, debug: ${debug}.`);
|
|
153
|
+
const emitLog = !enableDebugMode ? false : log.info(`Device: ${host} ${deviceName}, debug: ${debug}.`);
|
|
151
154
|
})
|
|
152
155
|
.on('warn', (warn) => {
|
|
153
156
|
const emitLog = disableLogWarn ? false : log.warn(`Device: ${host} ${deviceName}, ${warn}.`);
|
package/package.json
CHANGED
package/src/sensors.js
CHANGED
|
@@ -135,7 +135,7 @@ class Sensors extends EventEmitter {
|
|
|
135
135
|
load: sensorData.Load,
|
|
136
136
|
}
|
|
137
137
|
const sensor = key === 'ENERGY' ? { ...obj, ...obj1 } : obj;
|
|
138
|
-
this.emit('debug', `
|
|
138
|
+
const debug1 = this.enableDebugMode ? this.emit('debug', `Sensor: ${JSON.stringify(sensor, null, 2)}`) : false;
|
|
139
139
|
|
|
140
140
|
//push to array
|
|
141
141
|
this.sensors.push(sensor);
|
|
@@ -216,7 +216,7 @@ class Sensors extends EventEmitter {
|
|
|
216
216
|
|
|
217
217
|
try {
|
|
218
218
|
//accessory
|
|
219
|
-
const accessoryName =
|
|
219
|
+
const accessoryName = this.info.deviceName;
|
|
220
220
|
const accessoryUUID = AccessoryUUID.generate(this.serialNumber);
|
|
221
221
|
const accessoryCategory = Categories.SENSOR;
|
|
222
222
|
const accessory = new Accessory(accessoryName, accessoryUUID, accessoryCategory);
|