refactor(led): startup all-off, AP shows VFD, WS close no VFD change

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-03-19 22:08:47 +08:00
parent d68d673cdc
commit e36bec8660
2 changed files with 3 additions and 3 deletions

View File

@@ -64,8 +64,8 @@ class ClawClient {
async start() {
log.info('clawd', `启动中... 服务器 = ${this._cfg.server}`);
// 启动时默认 SETUP 亮(未激活状态),连接成功后按实际状态切换
led.status.setSetup();
// 启动时全灭WS 连接后由 _applyStatus() 按实际状态设置
led.status.off();
this._startSdNotify();
@@ -153,7 +153,6 @@ 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);
}

View File

@@ -109,6 +109,7 @@ class ProvisionManager extends EventEmitter {
if (this._state === 'ap') return;
led.off(); // AP 模式WiFi 未连接,灭灯
led.display.showAP(); // AP 模式VFD 显示 AP
try {
// AP 模式下无法扫描 WiFi必须在开 AP 之前扫描并缓存