refactor(led): startup all-off, AP shows VFD, WS close no VFD change
Made-with: Cursor
This commit is contained in:
@@ -64,8 +64,8 @@ class ClawClient {
|
|||||||
async start() {
|
async start() {
|
||||||
log.info('clawd', `启动中... 服务器 = ${this._cfg.server}`);
|
log.info('clawd', `启动中... 服务器 = ${this._cfg.server}`);
|
||||||
|
|
||||||
// 启动时默认 SETUP 亮(未激活状态),连接成功后按实际状态切换
|
// 启动时全灭,WS 连接后由 _applyStatus() 按实际状态设置
|
||||||
led.status.setSetup();
|
led.status.off();
|
||||||
|
|
||||||
this._startSdNotify();
|
this._startSdNotify();
|
||||||
|
|
||||||
@@ -153,7 +153,6 @@ class ClawClient {
|
|||||||
this._clearPing();
|
this._clearPing();
|
||||||
if (!this._stopped) {
|
if (!this._stopped) {
|
||||||
log.warn('clawd', `连接断开 (${code}),${this._backoff / 1000}s 后重连...`);
|
log.warn('clawd', `连接断开 (${code}),${this._backoff / 1000}s 后重连...`);
|
||||||
led.display.showAP(); // 断开云端 → 显示 AP
|
|
||||||
setTimeout(() => this._connect(), this._backoff);
|
setTimeout(() => this._connect(), this._backoff);
|
||||||
this._backoff = Math.min(this._backoff * 2, MAX_BACKOFF_MS);
|
this._backoff = Math.min(this._backoff * 2, MAX_BACKOFF_MS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ class ProvisionManager extends EventEmitter {
|
|||||||
if (this._state === 'ap') return;
|
if (this._state === 'ap') return;
|
||||||
|
|
||||||
led.off(); // AP 模式:WiFi 未连接,灭灯
|
led.off(); // AP 模式:WiFi 未连接,灭灯
|
||||||
|
led.display.showAP(); // AP 模式:VFD 显示 AP
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// AP 模式下无法扫描 WiFi,必须在开 AP 之前扫描并缓存
|
// AP 模式下无法扫描 WiFi,必须在开 AP 之前扫描并缓存
|
||||||
|
|||||||
Reference in New Issue
Block a user