homebridge-openwrt-control 0.0.2-beta.27 → 0.0.2-beta.29

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.
Files changed (2) hide show
  1. package/index.js +5 -6
  2. 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,11 +60,11 @@ class OpenWrtPlatform {
61
60
  log.info(`Device: ${host} ${name}, Config: ${JSON.stringify(safeConfig, null, 2)}`);
62
61
  }
63
62
 
63
+ const configuredDevices = [];
64
64
  const refreshInterval = (deviceConfig.refreshInterval ?? 5) * 1000;
65
- if (deviceConfig.accessPoint?.enable) this.devices.push('accessPoint');
66
- if (deviceConfig.switch?.enable) this.devices.push('switch');
67
-
68
- if (this.devices.length === 0) return;
65
+ if (deviceConfig.accessPoint?.enable) configuredDevices.push('accessPoint');
66
+ if (deviceConfig.switch?.enable) configuredDevices.push('switch');
67
+ if (configuredDevices.length === 0) return;
69
68
 
70
69
  const openWrt = new OpenWrt(deviceConfig)
71
70
  .on('success', msg => logLevel.success && log.success(`Device: ${host}, ${msg}`))
@@ -81,7 +80,7 @@ class OpenWrtPlatform {
81
80
  }
82
81
 
83
82
  try {
84
- for (const device of this.devices) {
83
+ for (const device of configuredDevices) {
85
84
  // create impulse generator
86
85
  const impulseGenerator = new ImpulseGenerator()
87
86
  .on('start', async () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "OpenWrt Control",
3
3
  "name": "homebridge-openwrt-control",
4
- "version": "0.0.2-beta.27",
4
+ "version": "0.0.2-beta.29",
5
5
  "description": "Homebridge plugin to control OpenWrt flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",