feat(vfd): showConn blink on WS connecting, showErr0 on VPS unreachable
Made-with: Cursor
This commit is contained in:
@@ -125,6 +125,7 @@ class ClawClient {
|
||||
_connect() {
|
||||
if (this._stopped) return;
|
||||
|
||||
if (this._wsFailCount < 3) led.display.showConn();
|
||||
log.info('clawd', `正在连接 ${this._cfg.server} ...`);
|
||||
const ws = new WebSocket(this._cfg.server, {
|
||||
handshakeTimeout: 10_000,
|
||||
@@ -160,7 +161,7 @@ class ClawClient {
|
||||
log.warn('clawd', `连接断开 (${code}),失败次数=${this._wsFailCount},${this._backoff / 1000}s 后重连...`);
|
||||
if (this._wsFailCount >= 3) {
|
||||
if (hasInternet()) {
|
||||
led.display.showErr('a'); // 有网但 VPS 不可达
|
||||
led.display.showErr0(); // 有网但 VPS 不可达
|
||||
} else {
|
||||
led.display.showAP(); // 无网,AP 模式
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user