homebridge-openwrt-control 0.0.2-beta.27 → 0.0.2-beta.28
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 +4 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -14,7 +14,6 @@ class OpenWrtPlatform {
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
this.accessories = [];
|
|
17
|
-
this.devices = [];
|
|
18
17
|
|
|
19
18
|
//check if prefs directory exist
|
|
20
19
|
const prefDir = join(api.user.storagePath(), 'openWrt');
|
|
@@ -61,9 +60,10 @@ class OpenWrtPlatform {
|
|
|
61
60
|
log.info(`Device: ${host} ${name}, Config: ${JSON.stringify(safeConfig, null, 2)}`);
|
|
62
61
|
}
|
|
63
62
|
|
|
63
|
+
const devices = [];
|
|
64
64
|
const refreshInterval = (deviceConfig.refreshInterval ?? 5) * 1000;
|
|
65
|
-
if (deviceConfig.accessPoint?.enable)
|
|
66
|
-
if (deviceConfig.switch?.enable)
|
|
65
|
+
if (deviceConfig.accessPoint?.enable) devices.push('accessPoint');
|
|
66
|
+
if (deviceConfig.switch?.enable) devices.push('switch');
|
|
67
67
|
|
|
68
68
|
if (this.devices.length === 0) return;
|
|
69
69
|
|
|
@@ -81,7 +81,7 @@ class OpenWrtPlatform {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
try {
|
|
84
|
-
for (const device of
|
|
84
|
+
for (const device of devices) {
|
|
85
85
|
// create impulse generator
|
|
86
86
|
const impulseGenerator = new ImpulseGenerator()
|
|
87
87
|
.on('start', async () => {
|
package/package.json
CHANGED