homebridge-tasmota-control 1.7.4-beta.0 → 1.7.4
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 +32 -33
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -35,39 +35,39 @@ class tasmotaPlatform {
|
|
|
35
35
|
const disableAccessory = device.disableAccessory || false;
|
|
36
36
|
if (disableAccessory) continue;
|
|
37
37
|
|
|
38
|
-
const deviceName = device.name;
|
|
39
|
-
const host = device.host;
|
|
40
|
-
if (!deviceName || !host) {
|
|
41
|
-
log.warn(`Device Name: ${deviceName ? 'OK' : deviceName}, host: ${host ? 'OK' : host}, in config wrong or missing.`);
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
//log config
|
|
46
|
-
const url = `http://${host}/cm?cmnd=`;
|
|
47
|
-
const auth = device.auth || false;
|
|
48
|
-
const user = device.user || '';
|
|
49
|
-
const passwd = device.passwd || '';
|
|
50
|
-
const loadNameFromDevice = device.loadNameFromDevice || false;
|
|
51
|
-
const refreshInterval = (device.refreshInterval ?? 5000) * 1000;
|
|
52
|
-
const enableDebugMode = device.enableDebugMode || false;
|
|
53
|
-
const logLevel = {
|
|
54
|
-
debug: device.enableDebugMode,
|
|
55
|
-
info: !device.disableLogInfo,
|
|
56
|
-
success: !device.disableLogSuccess,
|
|
57
|
-
warn: !device.disableLogWarn,
|
|
58
|
-
error: !device.disableLogError,
|
|
59
|
-
devInfo: !device.disableLogDeviceInfo,
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
if (logLevel.debug) log.info(`Device: ${host} ${deviceName}, debug: Did finish launching.`);
|
|
63
|
-
const newConfig = {
|
|
64
|
-
...device,
|
|
65
|
-
user: 'removed',
|
|
66
|
-
passwd: 'removed'
|
|
67
|
-
};
|
|
68
|
-
if (logLevel.debug) log.info(`Device: ${host} ${deviceName}, Config: ${JSON.stringify(newConfig, null, 2)}.`);
|
|
69
|
-
|
|
70
38
|
try {
|
|
39
|
+
const deviceName = device.name;
|
|
40
|
+
const host = device.host;
|
|
41
|
+
if (!deviceName || !host) {
|
|
42
|
+
log.warn(`Device Name: ${deviceName ? 'OK' : deviceName}, host: ${host ? 'OK' : host}, in config wrong or missing.`);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//log config
|
|
47
|
+
const url = `http://${host}/cm?cmnd=`;
|
|
48
|
+
const auth = device.auth || false;
|
|
49
|
+
const user = device.user || '';
|
|
50
|
+
const passwd = device.passwd || '';
|
|
51
|
+
const loadNameFromDevice = device.loadNameFromDevice || false;
|
|
52
|
+
const refreshInterval = (device.refreshInterval ?? 5000) * 1000;
|
|
53
|
+
const enableDebugMode = device.enableDebugMode || false;
|
|
54
|
+
const logLevel = {
|
|
55
|
+
debug: device.enableDebugMode,
|
|
56
|
+
info: !device.disableLogInfo,
|
|
57
|
+
success: !device.disableLogSuccess,
|
|
58
|
+
warn: !device.disableLogWarn,
|
|
59
|
+
error: !device.disableLogError,
|
|
60
|
+
devInfo: !device.disableLogDeviceInfo,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
if (logLevel.debug) log.info(`Device: ${host} ${deviceName}, debug: Did finish launching.`);
|
|
64
|
+
const newConfig = {
|
|
65
|
+
...device,
|
|
66
|
+
user: 'removed',
|
|
67
|
+
passwd: 'removed'
|
|
68
|
+
};
|
|
69
|
+
if (logLevel.debug) log.info(`Device: ${host} ${deviceName}, Config: ${JSON.stringify(newConfig, null, 2)}.`);
|
|
70
|
+
|
|
71
71
|
//create impulse generator
|
|
72
72
|
const impulseGenerator = new ImpulseGenerator()
|
|
73
73
|
.on('start', async () => {
|
|
@@ -160,7 +160,6 @@ class tasmotaPlatform {
|
|
|
160
160
|
|
|
161
161
|
//start impulse generator
|
|
162
162
|
await impulseGenerator.start([{ name: 'start', sampling: 60000 }]);
|
|
163
|
-
|
|
164
163
|
} catch (error) {
|
|
165
164
|
if (logLevel.error) log.error(`Device: ${host} ${deviceName}, Did finish launching error: ${error}.`);
|
|
166
165
|
}
|
package/package.json
CHANGED