homebridge-openwrt-control 0.0.2-beta.6 → 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.
- package/package.json +1 -1
- package/src/openwrt.js +3 -5
package/package.json
CHANGED
package/src/openwrt.js
CHANGED
|
@@ -7,10 +7,8 @@ class OpenWrt extends EventEmitter {
|
|
|
7
7
|
constructor(config) {
|
|
8
8
|
super();
|
|
9
9
|
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
this.user = config.user;
|
|
13
|
-
this.passwd = config.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(
|
|
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 => ({
|