hoffmation-base 2.22.15 → 2.22.16
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.
|
@@ -22,17 +22,18 @@ class UnifiRouter extends router_1.Router {
|
|
|
22
22
|
this.login();
|
|
23
23
|
}
|
|
24
24
|
reconnectDeviceByMac(mac) {
|
|
25
|
+
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Unifi: Reconnecting Device "${mac}"`);
|
|
25
26
|
return new Promise(async (resolve, _reject) => {
|
|
26
27
|
if (!this.loggedIn && !(await this.login())) {
|
|
27
|
-
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `Can't reconnect Device "${mac}" as we can't log in`);
|
|
28
|
+
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `Unifi: Can't reconnect Device "${mac}" as we can't log in`);
|
|
28
29
|
resolve(false);
|
|
29
30
|
}
|
|
30
31
|
const result = await this._api.reconnectClient(mac).catch((error) => {
|
|
31
|
-
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `Failed to reconnect "${mac}" due to: ${error}`);
|
|
32
|
+
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `Unifi: Failed to reconnect "${mac}" due to: ${error}`);
|
|
32
33
|
resolve(false);
|
|
33
34
|
return;
|
|
34
35
|
});
|
|
35
|
-
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Trace, `Reconnecting ${mac} resulted in ${result}`);
|
|
36
|
+
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Trace, `Unifi: Reconnecting ${mac} resulted in ${result}`);
|
|
36
37
|
resolve(true);
|
|
37
38
|
});
|
|
38
39
|
}
|
|
@@ -40,12 +41,14 @@ class UnifiRouter extends router_1.Router {
|
|
|
40
41
|
throw new Error('Method not implemented, use reconnectDeviceByMac instead.');
|
|
41
42
|
}
|
|
42
43
|
login() {
|
|
44
|
+
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Info, 'Unifi: Trying to login to Unifi-Controller');
|
|
43
45
|
return new Promise(async (resolve, _reject) => {
|
|
44
46
|
await this._api.login().catch((error) => {
|
|
45
|
-
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `Unifi
|
|
47
|
+
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `Unifi: Login failed: ${error}`);
|
|
46
48
|
this._loggedIn = false;
|
|
47
49
|
resolve(false);
|
|
48
50
|
});
|
|
51
|
+
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Info, 'Unifi: Login successful');
|
|
49
52
|
this._loggedIn = true;
|
|
50
53
|
resolve(true);
|
|
51
54
|
});
|