homebridge-deco 1.0.2 → 1.0.4
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/dist/decoAPI.d.ts +8 -20
- package/dist/decoAPI.js +67 -165
- package/dist/decoAPI.js.map +1 -1
- package/package.json +1 -1
package/dist/decoAPI.d.ts
CHANGED
|
@@ -35,34 +35,26 @@ export declare class DecoAPI {
|
|
|
35
35
|
private readonly log;
|
|
36
36
|
private readonly username;
|
|
37
37
|
private readonly password;
|
|
38
|
-
private
|
|
39
|
-
private
|
|
40
|
-
private
|
|
38
|
+
private routerUrl;
|
|
39
|
+
private stok;
|
|
40
|
+
private sysauth;
|
|
41
41
|
private lastAuthTime;
|
|
42
42
|
private readonly authValidityMs;
|
|
43
43
|
constructor(config: DecoConfig);
|
|
44
44
|
/**
|
|
45
|
-
* Authenticate with
|
|
45
|
+
* Authenticate with local Deco router using HTTPS API
|
|
46
46
|
*/
|
|
47
47
|
authenticate(): Promise<boolean>;
|
|
48
48
|
/**
|
|
49
|
-
* Get
|
|
50
|
-
*/
|
|
51
|
-
getDeviceList(): Promise<DecoDevice[]>;
|
|
52
|
-
/**
|
|
53
|
-
* Get network status including internet connectivity and guest network
|
|
49
|
+
* Get network status from local Deco router
|
|
54
50
|
*/
|
|
55
51
|
getNetworkStatus(): Promise<NetworkStatus>;
|
|
56
52
|
/**
|
|
57
|
-
* Get
|
|
58
|
-
*/
|
|
59
|
-
getClientList(): Promise<ConnectedClient[]>;
|
|
60
|
-
/**
|
|
61
|
-
* Get guest network status
|
|
53
|
+
* Get guest network status (placeholder for local API)
|
|
62
54
|
*/
|
|
63
55
|
getGuestNetworkStatus(): Promise<boolean>;
|
|
64
56
|
/**
|
|
65
|
-
*
|
|
57
|
+
* Set guest network on/off (placeholder for local API)
|
|
66
58
|
*/
|
|
67
59
|
setGuestNetwork(enabled: boolean): Promise<boolean>;
|
|
68
60
|
/**
|
|
@@ -70,11 +62,7 @@ export declare class DecoAPI {
|
|
|
70
62
|
*/
|
|
71
63
|
isDeviceConnected(mac: string): Promise<boolean>;
|
|
72
64
|
/**
|
|
73
|
-
*
|
|
74
|
-
*/
|
|
75
|
-
rebootDevice(deviceId: string): Promise<boolean>;
|
|
76
|
-
/**
|
|
77
|
-
* Make HTTP request to TP-Link API
|
|
65
|
+
* Make HTTPS request to local Deco router
|
|
78
66
|
*/
|
|
79
67
|
private makeRequest;
|
|
80
68
|
/**
|
package/dist/decoAPI.js
CHANGED
|
@@ -1,47 +1,41 @@
|
|
|
1
|
-
import { randomUUID } from 'crypto';
|
|
2
1
|
export class DecoAPI {
|
|
3
2
|
log;
|
|
4
3
|
username;
|
|
5
4
|
password;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
routerUrl = 'https://192.168.68.1';
|
|
6
|
+
stok = '';
|
|
7
|
+
sysauth = '';
|
|
9
8
|
lastAuthTime = 0;
|
|
10
9
|
authValidityMs = 3600000; // 1 hour
|
|
11
10
|
constructor(config) {
|
|
12
11
|
this.log = config.log;
|
|
13
12
|
this.username = config.username;
|
|
14
13
|
this.password = config.password;
|
|
15
|
-
this.termid = randomUUID();
|
|
16
14
|
}
|
|
17
15
|
/**
|
|
18
|
-
* Authenticate with
|
|
16
|
+
* Authenticate with local Deco router using HTTPS API
|
|
19
17
|
*/
|
|
20
18
|
async authenticate() {
|
|
21
19
|
try {
|
|
22
20
|
// Check if we have a valid token already
|
|
23
|
-
if (this.
|
|
21
|
+
if (this.stok && (Date.now() - this.lastAuthTime) < this.authValidityMs) {
|
|
24
22
|
return true;
|
|
25
23
|
}
|
|
26
|
-
this.log.debug('Authenticating with
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
params: {
|
|
30
|
-
|
|
31
|
-
cloudUserName: this.username,
|
|
32
|
-
cloudPassword: this.password,
|
|
33
|
-
terminalUUID: this.termid,
|
|
34
|
-
},
|
|
24
|
+
this.log.debug('Authenticating with local Deco router at:', this.routerUrl);
|
|
25
|
+
// Deco router only needs password for login
|
|
26
|
+
const loginData = {
|
|
27
|
+
params: { password: this.password },
|
|
28
|
+
operation: 'login',
|
|
35
29
|
};
|
|
36
|
-
const response = await this.makeRequest('
|
|
30
|
+
const response = await this.makeRequest('login', JSON.stringify(loginData));
|
|
37
31
|
if (response.error_code !== 0) {
|
|
38
32
|
this.log.error('Authentication failed:', response.msg || 'Unknown error');
|
|
39
33
|
return false;
|
|
40
34
|
}
|
|
41
|
-
if (response.result && typeof response.result === 'object' && '
|
|
42
|
-
this.
|
|
35
|
+
if (response.result && typeof response.result === 'object' && 'stok' in response.result) {
|
|
36
|
+
this.stok = response.result.stok;
|
|
43
37
|
this.lastAuthTime = Date.now();
|
|
44
|
-
this.log.info('Successfully authenticated with
|
|
38
|
+
this.log.info('Successfully authenticated with local Deco router');
|
|
45
39
|
return true;
|
|
46
40
|
}
|
|
47
41
|
this.log.error('Invalid authentication response');
|
|
@@ -53,121 +47,54 @@ export class DecoAPI {
|
|
|
53
47
|
}
|
|
54
48
|
}
|
|
55
49
|
/**
|
|
56
|
-
* Get
|
|
57
|
-
*/
|
|
58
|
-
async getDeviceList() {
|
|
59
|
-
try {
|
|
60
|
-
if (!await this.ensureAuthenticated()) {
|
|
61
|
-
return [];
|
|
62
|
-
}
|
|
63
|
-
const params = {
|
|
64
|
-
method: 'getDeviceList',
|
|
65
|
-
params: {},
|
|
66
|
-
};
|
|
67
|
-
const response = await this.makeRequest('/', params);
|
|
68
|
-
if (response.error_code !== 0) {
|
|
69
|
-
this.log.error('Failed to get device list:', response.msg);
|
|
70
|
-
return [];
|
|
71
|
-
}
|
|
72
|
-
if (response.result && typeof response.result === 'object' && 'deviceList' in response.result) {
|
|
73
|
-
const devices = response.result.deviceList || [];
|
|
74
|
-
this.log.debug(`Found ${devices.length} Deco devices`);
|
|
75
|
-
return devices;
|
|
76
|
-
}
|
|
77
|
-
return [];
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
this.log.error('Error getting device list:', error);
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Get network status including internet connectivity and guest network
|
|
50
|
+
* Get network status from local Deco router
|
|
86
51
|
*/
|
|
87
52
|
async getNetworkStatus() {
|
|
88
53
|
try {
|
|
89
54
|
if (!await this.ensureAuthenticated()) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
55
|
+
this.log.error('Not authenticated, cannot get network status');
|
|
56
|
+
return { internetOnline: false, guestNetworkEnabled: false, devices: [], clients: [] };
|
|
57
|
+
}
|
|
58
|
+
const wanData = await this.makeRequest('admin/network?form=wan_ipv4', JSON.stringify({ operation: 'read' }));
|
|
59
|
+
const clientData = await this.makeRequest('admin/client?form=client_list', JSON.stringify({ operation: 'read' }));
|
|
60
|
+
const internetOnline = wanData?.wan?.inet_status === 'online';
|
|
61
|
+
const clientList = clientData?.client_list || [];
|
|
62
|
+
const clients = clientList.map((client) => ({
|
|
63
|
+
mac: typeof client.mac === 'string' ? client.mac : '',
|
|
64
|
+
name: client.name ? Buffer.from(client.name, 'base64').toString('utf-8') : '',
|
|
65
|
+
ip: typeof client.ip === 'string' ? client.ip : '',
|
|
66
|
+
online: client.online === true,
|
|
67
|
+
downSpeed: typeof client.down_speed === 'number' ? client.down_speed : 0,
|
|
68
|
+
upSpeed: typeof client.up_speed === 'number' ? client.up_speed : 0,
|
|
69
|
+
connectedNode: client.access_host ? String(client.access_host) : '',
|
|
70
|
+
}));
|
|
104
71
|
return {
|
|
105
72
|
internetOnline,
|
|
106
|
-
guestNetworkEnabled: guestNetwork,
|
|
107
|
-
devices,
|
|
108
|
-
clients,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
catch (error) {
|
|
112
|
-
this.log.error('Error getting network status:', error);
|
|
113
|
-
return {
|
|
114
|
-
internetOnline: false,
|
|
115
73
|
guestNetworkEnabled: false,
|
|
116
74
|
devices: [],
|
|
117
|
-
clients
|
|
75
|
+
clients,
|
|
118
76
|
};
|
|
119
77
|
}
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Get list of connected clients
|
|
123
|
-
*/
|
|
124
|
-
async getClientList() {
|
|
125
|
-
try {
|
|
126
|
-
if (!await this.ensureAuthenticated()) {
|
|
127
|
-
return [];
|
|
128
|
-
}
|
|
129
|
-
const params = {
|
|
130
|
-
method: 'getClientList',
|
|
131
|
-
params: {},
|
|
132
|
-
};
|
|
133
|
-
const response = await this.makeRequest('/', params);
|
|
134
|
-
if (response.error_code !== 0) {
|
|
135
|
-
this.log.debug('Failed to get client list:', response.msg);
|
|
136
|
-
return [];
|
|
137
|
-
}
|
|
138
|
-
if (response.result && typeof response.result === 'object' && 'clientList' in response.result) {
|
|
139
|
-
const clients = response.result.clientList || [];
|
|
140
|
-
this.log.debug(`Found ${clients.length} connected clients`);
|
|
141
|
-
return clients;
|
|
142
|
-
}
|
|
143
|
-
return [];
|
|
144
|
-
}
|
|
145
78
|
catch (error) {
|
|
146
|
-
this.log.error('Error getting
|
|
147
|
-
return [];
|
|
79
|
+
this.log.error('Error getting network status:', error);
|
|
80
|
+
return { internetOnline: false, guestNetworkEnabled: false, devices: [], clients: [] };
|
|
148
81
|
}
|
|
149
82
|
}
|
|
150
83
|
/**
|
|
151
|
-
* Get guest network status
|
|
84
|
+
* Get guest network status (placeholder for local API)
|
|
152
85
|
*/
|
|
153
86
|
async getGuestNetworkStatus() {
|
|
154
87
|
try {
|
|
155
88
|
if (!await this.ensureAuthenticated()) {
|
|
156
89
|
return false;
|
|
157
90
|
}
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
};
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
return false;
|
|
166
|
-
}
|
|
167
|
-
if (response.result && typeof response.result === 'object' && 'enabled' in response.result) {
|
|
168
|
-
return response.result.enabled === true;
|
|
169
|
-
}
|
|
170
|
-
return false;
|
|
91
|
+
const wlanData = await this.makeRequest('admin/wireless?form=wlan', JSON.stringify({ operation: 'read' }));
|
|
92
|
+
// Check if guest network is enabled on 2.4G or 5G bands
|
|
93
|
+
const band2_4 = wlanData?.band2_4 || {};
|
|
94
|
+
const band5_1 = wlanData?.band5_1 || {};
|
|
95
|
+
const guest2g = band2_4.guest?.enable === true;
|
|
96
|
+
const guest5g = band5_1.guest?.enable === true;
|
|
97
|
+
return guest2g || guest5g;
|
|
171
98
|
}
|
|
172
99
|
catch (error) {
|
|
173
100
|
this.log.debug('Error getting guest network status:', error);
|
|
@@ -175,7 +102,7 @@ export class DecoAPI {
|
|
|
175
102
|
}
|
|
176
103
|
}
|
|
177
104
|
/**
|
|
178
|
-
*
|
|
105
|
+
* Set guest network on/off (placeholder for local API)
|
|
179
106
|
*/
|
|
180
107
|
async setGuestNetwork(enabled) {
|
|
181
108
|
try {
|
|
@@ -183,16 +110,13 @@ export class DecoAPI {
|
|
|
183
110
|
return false;
|
|
184
111
|
}
|
|
185
112
|
const params = {
|
|
186
|
-
|
|
113
|
+
operation: 'write',
|
|
187
114
|
params: {
|
|
188
|
-
enabled,
|
|
115
|
+
band2_4: { guest: { enable: enabled } },
|
|
116
|
+
band5_1: { guest: { enable: enabled } },
|
|
189
117
|
},
|
|
190
118
|
};
|
|
191
|
-
|
|
192
|
-
if (response.error_code !== 0) {
|
|
193
|
-
this.log.error('Failed to set guest network:', response.msg);
|
|
194
|
-
return false;
|
|
195
|
-
}
|
|
119
|
+
await this.makeRequest('admin/wireless?form=wlan', JSON.stringify(params));
|
|
196
120
|
this.log.info(`Guest network ${enabled ? 'enabled' : 'disabled'}`);
|
|
197
121
|
return true;
|
|
198
122
|
}
|
|
@@ -206,9 +130,9 @@ export class DecoAPI {
|
|
|
206
130
|
*/
|
|
207
131
|
async isDeviceConnected(mac) {
|
|
208
132
|
try {
|
|
209
|
-
const
|
|
133
|
+
const status = await this.getNetworkStatus();
|
|
210
134
|
const normalizedMac = mac.toLowerCase().replace(/[:-]/g, '');
|
|
211
|
-
return clients.some(client => {
|
|
135
|
+
return status.clients.some(client => {
|
|
212
136
|
const clientMac = client.mac.toLowerCase().replace(/[:-]/g, '');
|
|
213
137
|
return clientMac === normalizedMac && client.online;
|
|
214
138
|
});
|
|
@@ -219,69 +143,47 @@ export class DecoAPI {
|
|
|
219
143
|
}
|
|
220
144
|
}
|
|
221
145
|
/**
|
|
222
|
-
*
|
|
223
|
-
*/
|
|
224
|
-
async rebootDevice(deviceId) {
|
|
225
|
-
try {
|
|
226
|
-
if (!await this.ensureAuthenticated()) {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
const params = {
|
|
230
|
-
method: 'reboot',
|
|
231
|
-
params: {
|
|
232
|
-
deviceId,
|
|
233
|
-
},
|
|
234
|
-
};
|
|
235
|
-
const response = await this.makeRequest('/', params);
|
|
236
|
-
if (response.error_code !== 0) {
|
|
237
|
-
this.log.error('Failed to reboot device:', response.msg);
|
|
238
|
-
return false;
|
|
239
|
-
}
|
|
240
|
-
this.log.info(`Rebooted device ${deviceId}`);
|
|
241
|
-
return true;
|
|
242
|
-
}
|
|
243
|
-
catch (error) {
|
|
244
|
-
this.log.error('Error rebooting device:', error);
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Make HTTP request to TP-Link API
|
|
146
|
+
* Make HTTPS request to local Deco router
|
|
250
147
|
*/
|
|
251
|
-
async makeRequest(
|
|
252
|
-
const url = `${this.
|
|
148
|
+
async makeRequest(path, body) {
|
|
149
|
+
const url = `${this.routerUrl}/cgi-bin/luci/;stok=${this.stok}/${path}`;
|
|
253
150
|
const headers = {
|
|
254
151
|
'Content-Type': 'application/json',
|
|
255
|
-
'User-Agent': 'Deco/3.0 (iPhone; iOS 15.0; Scale/3.00)',
|
|
256
152
|
};
|
|
257
|
-
|
|
258
|
-
headers.Authorization = `Bearer ${this.token}`;
|
|
259
|
-
}
|
|
260
|
-
const body = JSON.stringify(params);
|
|
153
|
+
this.log.debug(`API request - URL: ${url}`);
|
|
261
154
|
try {
|
|
155
|
+
// Use Node.js fetch with self-signed certificate support
|
|
262
156
|
const response = await fetch(url, {
|
|
263
157
|
method: 'POST',
|
|
264
158
|
headers,
|
|
265
159
|
body,
|
|
160
|
+
redirect: 'manual',
|
|
161
|
+
// @ts-expect-error - Node.js fetch supports agent parameter
|
|
162
|
+
agent: new (await import('https')).Agent({ rejectUnauthorized: false }),
|
|
266
163
|
});
|
|
164
|
+
// Handle redirects
|
|
165
|
+
if (response.status >= 300 && response.status < 400) {
|
|
166
|
+
const location = response.headers.get('location');
|
|
167
|
+
this.log.error(`API returned redirect (${response.status}) to: ${location}`);
|
|
168
|
+
throw new Error(`API redirect to ${location} - authentication may have failed`);
|
|
169
|
+
}
|
|
267
170
|
if (!response.ok) {
|
|
268
171
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
269
172
|
}
|
|
270
173
|
const text = await response.text();
|
|
271
|
-
// Try to parse as JSON, but handle HTML error pages gracefully
|
|
272
174
|
try {
|
|
273
175
|
const data = JSON.parse(text);
|
|
274
176
|
return data;
|
|
275
177
|
}
|
|
276
178
|
catch (parseError) {
|
|
277
179
|
if (text.trim().startsWith('<!DOCTYPE') || text.trim().startsWith('<html')) {
|
|
278
|
-
this.log.error('API returned HTML instead of JSON. Response preview:', text.substring(0,
|
|
279
|
-
this.log.error('
|
|
180
|
+
this.log.error('API returned HTML instead of JSON. Response preview:', text.substring(0, 300));
|
|
181
|
+
this.log.error('Router may not be accessible or API endpoint is wrong.');
|
|
280
182
|
}
|
|
281
183
|
else {
|
|
282
184
|
this.log.error('Failed to parse API response as JSON:', text);
|
|
283
185
|
}
|
|
284
|
-
throw new Error('Invalid JSON response from
|
|
186
|
+
throw new Error('Invalid JSON response from Deco router');
|
|
285
187
|
}
|
|
286
188
|
}
|
|
287
189
|
catch (error) {
|
|
@@ -293,7 +195,7 @@ export class DecoAPI {
|
|
|
293
195
|
* Ensure we have a valid authentication token
|
|
294
196
|
*/
|
|
295
197
|
async ensureAuthenticated() {
|
|
296
|
-
if (!this.
|
|
198
|
+
if (!this.stok || (Date.now() - this.lastAuthTime) >= this.authValidityMs) {
|
|
297
199
|
return await this.authenticate();
|
|
298
200
|
}
|
|
299
201
|
return true;
|
package/dist/decoAPI.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decoAPI.js","sourceRoot":"","sources":["../src/decoAPI.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decoAPI.js","sourceRoot":"","sources":["../src/decoAPI.ts"],"names":[],"mappings":"AAsCA,MAAM,OAAO,OAAO;IACD,GAAG,CAAU;IACb,QAAQ,CAAS;IACjB,QAAQ,CAAS;IAC1B,SAAS,GAAW,sBAAsB,CAAC;IAC3C,IAAI,GAAW,EAAE,CAAC;IAClB,OAAO,GAAW,EAAE,CAAC;IACrB,YAAY,GAAW,CAAC,CAAC;IAChB,cAAc,GAAG,OAAO,CAAC,CAAC,SAAS;IAEpD,YAAY,MAAkB;QAC5B,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY;QAChB,IAAI,CAAC;YACH,yCAAyC;YACzC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxE,OAAO,IAAI,CAAC;YACd,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,2CAA2C,EAA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AAC,mBAAmB;QAC/B,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YAC1E,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QACnC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "homebridge-deco",
|
|
3
3
|
"displayName": "TP-Link Deco",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.4",
|
|
6
6
|
"description": "Homebridge plugin for TP-Link Deco mesh network system with support for network monitoring, device tracking, and network controls.",
|
|
7
7
|
"author": "Fabian Oley",
|
|
8
8
|
"license": "Apache-2.0",
|