refactor(display): tie VFD display to WS connection state only
Made-with: Cursor
This commit is contained in:
@@ -131,6 +131,7 @@ class ClawClient {
|
||||
this._backoff = 1_000;
|
||||
this._sendConnect();
|
||||
this._startPing();
|
||||
led.display.showTime(); // 连上云端 → 显示时间
|
||||
});
|
||||
|
||||
ws.on('message', (data) => {
|
||||
@@ -150,6 +151,7 @@ class ClawClient {
|
||||
this._clearPing();
|
||||
if (!this._stopped) {
|
||||
log.warn('clawd', `连接断开 (${code}),${this._backoff / 1000}s 后重连...`);
|
||||
led.display.showAP(); // 断开云端 → 显示 AP
|
||||
setTimeout(() => this._connect(), this._backoff);
|
||||
this._backoff = Math.min(this._backoff * 2, MAX_BACKOFF_MS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user