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.
Files changed (2) hide show
  1. package/index.js +4 -4
  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,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) this.devices.push('accessPoint');
66
- if (deviceConfig.switch?.enable) this.devices.push('switch');
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 this.devices) {
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
@@ -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.28",
5
5
  "description": "Homebridge plugin to control OpenWrt flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",