homebridge-openwrt-control 0.0.2-beta.17 → 0.0.2-beta.18
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 +2 -4
package/package.json
CHANGED
package/src/openwrt.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import EventEmitter from 'events';
|
|
2
2
|
import axios from 'axios';
|
|
3
|
-
import http from 'http';
|
|
4
3
|
import Functions from './functions.js';
|
|
5
4
|
import ImpulseGenerator from './impulsegenerator.js';
|
|
6
5
|
|
|
@@ -28,7 +27,6 @@ class OpenWrt extends EventEmitter {
|
|
|
28
27
|
method: 'POST',
|
|
29
28
|
baseURL: `http://${config.host}`,
|
|
30
29
|
timeout: 5000,
|
|
31
|
-
httpAgent: new http.Agent({ keepAlive: false }),
|
|
32
30
|
headers: {
|
|
33
31
|
"Content-Type": "application/json"
|
|
34
32
|
}
|
|
@@ -50,8 +48,7 @@ class OpenWrt extends EventEmitter {
|
|
|
50
48
|
try {
|
|
51
49
|
await fn();
|
|
52
50
|
} catch (error) {
|
|
53
|
-
this.emit('error', `Impulse generator error: ${error.message}`
|
|
54
|
-
);
|
|
51
|
+
this.emit('error', `Impulse generator error: ${error.message}`);
|
|
55
52
|
} finally {
|
|
56
53
|
this.lock = false;
|
|
57
54
|
}
|
|
@@ -63,6 +60,7 @@ class OpenWrt extends EventEmitter {
|
|
|
63
60
|
return this.sessionId;
|
|
64
61
|
}
|
|
65
62
|
|
|
63
|
+
this.emit('debug', `Login: ${this.usere} ${this.passwd}`)
|
|
66
64
|
const response = await this.axiosInstance('/ubus', {
|
|
67
65
|
jsonrpc: '2.0',
|
|
68
66
|
id: 1,
|