homebridge-openwrt-control 0.0.2-beta.7 → 0.0.2-beta.8

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/package.json +1 -1
  2. package/src/openwrt.js +3 -5
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.7",
4
+ "version": "0.0.2-beta.8",
5
5
  "description": "Homebridge plugin to control OpenWrt flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/openwrt.js CHANGED
@@ -7,10 +7,8 @@ class OpenWrt extends EventEmitter {
7
7
  constructor(config) {
8
8
  super();
9
9
 
10
- this.name = config.name;
11
- this.host = config.host;
12
- this.user = config.auth.user;
13
- this.passwd = config.auth.passwd;
10
+ this.user = config.auth?.user;
11
+ this.passwd = config.auth?.passwd;
14
12
  this.logError = config.log?.error;
15
13
  this.logDebug = config.log?.debug;
16
14
 
@@ -108,7 +106,7 @@ class OpenWrt extends EventEmitter {
108
106
  const wirelessStatus = await this.ubusCall('network.wireless', 'status');
109
107
  if (this.logDebug) this.emit('debug', `Wireless status data: ${JSON.stringify(wirelessStatus, null, 2)}`);
110
108
 
111
- const wirelessRadios = Object.values(status.radios).map(radio => ({
109
+ const wirelessRadios = Object.values(wirelessStatus.radios).map(radio => ({
112
110
  name: radio.name,
113
111
  state: radio.up === true,
114
112
  interfaces: Object.values(radio.interfaces).map(i => ({